Required Field Validator

6 posts, 0 answers
  1. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 06 Feb 2009 Link to this post

    I have a number of radtextbox fields on my screen. in addition I have a radgrid in which i can click on a row, it puts the information in the textboxes at the top of the screen where i can edit them. my question is why do all the 'required' field validators kick in when i do an edit, even though the fields have data in them. before, the way the validators worked is they would not show up unless you either a) tabbed out of the field without entering data or b) pressed 'save' and the field was blank. now they show up before the user even has time to enter data. another example is if you have a dropdown as your first field. the minute you pick something from the dropdown, all the required validators show up. the user has not even gone to those fields yet. hopefully, this explained my situation. is there a setting i'm missing?

    thanks,
    susan
  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 09 Feb 2009 Link to this post

    Hi Susan,

    To exclude the controls in the grid as triggers of the page validation mechanism, you can disable the validation for the control as shown in this demo:

    http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/validation/defaultcs.aspx

    Moreover, if you want to disable the validation for the edit buttons in rows individually, consider intercepting the ItemCreated or ItemDataBound event of the grid, find the edit button in the corresponding record using the approach from here and set its CausesValidation property to false.

    Best regards,
    Sebastian
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 26 Feb 2009 Link to this post

    sorry, ignore the radgrid example - it was a bad example for my situation. I have a dropdown as my first control and then a number of textboxes after that and they are all required. when i make a selection from my first control, the dropdown, all the required validators pop up. i have not even reached these fields yet to give the user a chance to enter them, so i don't want the validator appearing. i tried to put a 'causesvalidation=false' on the dropdown, but that did not work. can you tell me how to do this?

    thanks,
    susan
  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 27 Feb 2009 Link to this post

    Hi Susan,

    The answers to the following questions can help us determine the cause of this behavior:
    • Do you use standard MS DropDownList control in this case or RadComboBox?
    • Did you set AutoPostBack = true for the dropdown when the validation is triggered? Does switching this property to false makes a difference? 

    Regards,

    Sebastian

    the Telerik team


    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Susan
    Susan avatar
    137 posts
    Member since:
    Jul 2007

    Posted 28 Feb 2009 Link to this post

    Hi Sebastian,
    To answer your questions.
    1. RadComboBox
    2. Yes, I use Autopostback=true, as it has to load another RadComboBox upon selection of the first.
    3. If I remove the autopostback, the validators do not get trigger. However, I need it on the page to load another dropdown.

    Thanks for the help!
    Susan
  7. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 03 Mar 2009 Link to this post

    Hi Susan,

    You need to use ValidationGroups as shown in this online demo.

    I hope this will get you started.

    Kind regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017