This is a migrated thread and some comments may be shown as answers.

Required Field Validator

5 Answers 442 Views
Input
This is a migrated thread and some comments may be shown as answers.
Susan
Top achievements
Rank 1
Susan asked on 07 Feb 2009, 12:56 AM
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

5 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 09 Feb 2009, 03:47 PM
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.
0
Susan
Top achievements
Rank 1
answered on 26 Feb 2009, 06:58 PM
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
0
Sebastian
Telerik team
answered on 27 Feb 2009, 09:09 AM
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.
0
Susan
Top achievements
Rank 1
answered on 28 Feb 2009, 06:00 PM
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
0
Veselin Vasilev
Telerik team
answered on 03 Mar 2009, 12:34 PM
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.
Tags
Input
Asked by
Susan
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Susan
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or