#1
  1. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,664
    Rep Power
    171

    Very difficult to explain. On blur reload the from, focus on 'clicked' element


    Hi;

    On blur I reload a form in the div. All working fine the problem is newlly reloaded form does not have any focus.

    I need to find a way to put the focus on the clicked element.

    How can I pass what element has been clicked when I am using onblur?

    And I cannot use "onclick reload form", it has to be "onblur relaod form".

    I know its a bit vague, but I really appreciate any help.

    EDIT:
    Onclick happens before onblur, I might be able to change some input values like that and pass them to the other form!

    Thanks
    Last edited by zxcvbnm; July 24th, 2013 at 02:25 AM.
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,158
    Rep Power
    184
    Originally Posted by zxcvbnm
    On blur I reload a form in the div. All working fine the problem is newlly reloaded form does not have any focus.
    When you say "reload"; do you mean you reset the form or create a totally new form?

    Originally Posted by zxcvbnm
    I need to find a way to put the focus on the clicked element.

    How can I pass what element has been clicked when I am using onblur?
    Just pass the element's id attribute to your function and then focus() on that element's id, from within your function..., after you "reload" the form.
  4. #3
  5. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,664
    Rep Power
    171

    Unhappy


    Originally Posted by web_loone08
    When you say "reload"; do you mean you reset the form or create a totally new form?
    Yes. A whole new page.
    Originally Posted by web_loone08
    Just pass the element's id attribute to your function and then focus() on that element's id, from within your function..., after you "reload" the form.
    I can't because I am reloading the form onblur (of the currently focused element).


    Edit:

    I guess onblur I have to update each form box individually! That's the only solution I can come up with.
    Last edited by zxcvbnm; July 24th, 2013 at 07:11 PM.
  6. #4
  7. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,158
    Rep Power
    184
    You could always send the last focused element's id to the next page; with the sessionStorage() Object or send it in a query string.
  8. #5
  9. A Change of Season
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2004
    Location
    Next Door
    Posts
    2,664
    Rep Power
    171
    Originally Posted by web_loone08
    You could always send the last focused element's id to the next page; with the sessionStorage() Object or send it in a query string.
    Hi;

    I sent you a privat emessage with the link

    Please let me know what you think. Thanks

IMN logo majestic logo threadwatch logo seochat tools logo