Click Event not firing

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Abbas82
    New Member
    • Oct 2006
    • 5

    Click Event not firing

    Hello,

    I am working on a site with an input form that has required field
    validators. If the user doesn't enter something in one of the
    textboxes, the error message appears. When they enter something and:

    1) goto another field on the form (the error message clears) then
    click OK, the click event fires as expected
    2) click OK without focusing on another field, only the error message
    is cleared but the click event is never fired, hence forcing the user
    to click OK one more time to submit

    Any idea why this weird behaviour is happening? I tried it on a
    simple page with just a couple of textboxes and it worked fine, so I
    am not sure why this is acting differently?

    Any comments would be much appreciated.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    I would say it's because the textchanged even is an auto-postback. When you lose focus from the textbox that event is fired. Clicking the button without switching to a diffrent field calls the lost-focus/text-changed event to fire before the click event. So it goes and reloads the page, forcing you to have to click again for the click event to fire.

    That is my guess as least

    Comment

    Working...