Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Refilling Form Fields after losing mouse focus

    Hi All,

    In my work here there is an application that has recently had a plugin coded up for it, the plugin allows custom message boxes to be opened up by the user when they roll on the help icons.

    The boxes open automatically and then close as soon as the mouse focus rolls off their box area.

    The boxes support java script content and html etc so can be very customised.

    I have coded a user form with various data capture fields.
    I would like the data in the fields to be reloaded if the user accidentally rolls off the box (as this will close it and the behavious cannot be changed :-<)

    I have used cookies and tested in browser and all the retreival and storage of the cookie data works fine.
    Problem is with this plugin app is that i cannot fit in the call to 'onload CheckForCookies()' anywhere - The boxes do not seem to appear as 'window opening events' so could anybody suggest a way of Adding the call to checkforcookies() into my form loading - that does not depend on a window opening event? There are four or five fields and i would like them all to update with whatever was last in them when the messagebox opens - it is not an api/ browser generated messge box, rather it is a custom web widget of some sort and i do not have access to the source code at this time.

    It is equally important to be able to create or refresh the cookie data for the fields when the user rolls off the box so they do not lose whatever info was typed in so far so i need to call like 'onunload SetAllCookies'

    Like i say i have the code to do the work, the problem is the functions are not being called as the behaviour of the little boxes does not trigger them as load / unload eventrs. I tested using 'onfocus' and this works but is nbo good as the user would only see the data they had 'lost' when they click on a field.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,211
    Thanks
    23
    Thanked 605 Times in 604 Posts
    The easiest thing would be to have to new app. changed to keep the custom message box permanently open if the help icon was clicked and the boxes closed by a red X in the upper right corner.

    Barring that - if js is placed immediately after the body tag it will run at start up. So look for your cookies there and set variables. Don't use functions. Make sure your cookies have a short life, but not deleted upon exit and that you kill them when your info is submitted.

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by sunfighter View Post
    The easiest thing would be to have to new app. changed to keep the custom message box permanently open if the help icon was clicked and the boxes closed by a red X in the upper right corner.

    Barring that - if js is placed immediately after the body tag it will run at start up. So look for your cookies there and set variables. Don't use functions. Make sure your cookies have a short life, but not deleted upon exit and that you kill them when your info is submitted.
    Ah, good thinking, i think the embedding script into body section might help thanks. Regarding the changes to the app - yes i would like that but unfortunately the app was not designed very well it seems and we would basically be looking at a whole new version : ie one that supports different open close events and staying open until told otherwise... Pretty poor coding that this is not allowed for already but there you go.!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •