Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP.net Regex Validator problem

Options
  • 16-10-2009 12:05pm
    #1
    Registered Users Posts: 2,791 ✭✭✭


    I'm come across a bug in the .net regular expression validators and would appreciate any suggestions as to how to get around it.

    To reproduce, setup a Regex validator to validate a textbox. Open the page in Firefox and enter a valid value. Click submit or perform a postback so the value is saved in the textbox history.

    Reload the page, and start typing the same value again. Firefox presents you with the same value from autocomplete/textbox history.

    If you select this value with the mouse, everything is fine. However, if you select with the arrow keys & press enter, the validator is incorrectly triggered. If you try to postback, the validator will disappear.

    It seems to me that the validator is triggered by the enter key, and only takes the values you typed rather than the full value you selected from autocomplete.

    I cant see a way around this other than to write my own client side regex validator. Any suggestions?

    Thanks :)


Comments

  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Is their an autopostback property set to true that should perhaps be set to false? Probably a default submit button or something.


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    Yes there is, we have added client side script to handle an the Enter key being pressed. Thanks :o


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    Can you edit your original post as set it to [Solved]? thanks.


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    Evil Phil wrote: »
    Can you edit your original post as set it to [Solved]? thanks.

    I would if I could, but there's no edit option


  • Registered Users Posts: 7,468 ✭✭✭Evil Phil


    s'cool, I did it for you. The post was probably to old for you to edit.


  • Advertisement
Advertisement