RadComboBox with Required Field Validator - IE issues when clearing with X

3 posts, 0 answers
  1. John
    John avatar
    31 posts
    Member since:
    May 2014

    Posted 14 Mar Link to this post


    I have a RadComboBox with an associated required field validator. On Internet Explorer 11 (maybe other versions) an X appears that allows the user to clear the Combo. Please see the attached image if you don't know what I mean.

    If the user clears the selection with the X and then clicks elsewhere (on another control for example) then the required field validator for the RadComboBox will activate. I only want this validator (and the other validators) to fire when the page is posted back.

    There are a couple of the approaches that I have investigated but couldn't make get to work 100% correctly for various reasons are

    1. Disable the validator temporarily with Javascript and re-enable later on. As per this thread Radcombobox clearSelection causes validation.
    2. Use a custom validator.

    The second one isn't really an option because the RadComboBox is used in an .ascx file that is re-used in a lot of places. Also, some attributes that are specific to a RequiredFieldValidator are required.

    So, I am asking if there is a simple low impact way of preventing the validator from firing in this scenario?

    Thanks in advance,

  2. John
    John avatar
    31 posts
    Member since:
    May 2014

    Posted 14 Mar Link to this post

    Posting the image now.
  3. DevCraft R3 2016 release webinar banner
  4. Veselin Tsvetanov
    Veselin Tsvetanov avatar
    242 posts

    Posted 17 Mar Link to this post

    Hi John,

    Clicking the 'X' sign should clear the text from the input field. However it does not apply changes to the selection in the RadComboBox control. As you can see in the below video, after clearing the input field and performing postback, the selected item remains and the validation does not fail:

    You could consult the following articles to learn how to enable / disable RequiredFieldValidatior:
    Enable/Disable Required field validator from cs page?
    Disabling/enabling requiredFieldValidators with javascript and server side

    Veselin Tsvetanov
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top