I have a page with about a dozen or so required field validators on and a button that is set to causesvalidation=true. My issue is that i only want this particular button to validate only 3 or 4 of these validators.
If I understand correctly, you want to tie the button to only 3 or 4 of your validators while the remaining validators will be triggered elsewhere. You can easily accomplish this through the ValidationGroup attribute. Simply add this attribute to all of
the validators you want to tie together AND to the button that will cause the validation.
Pseudo code
<Validator1 ValidationGroup="group1" />
<Validator2 ValidationGroup="group1" />
<Button ValidationGroup="group1" />
"What I hear, I forget; What I see, I remember; What I do, I understand." --Confucius
Remeber to Mark as Answer if this post helped you.
sconly
Member
62 Points
112 Posts
Partial validation
Apr 27, 2012 02:58 PM|LINK
I have a page with about a dozen or so required field validators on and a button that is set to causesvalidation=true. My issue is that i only want this particular button to validate only 3 or 4 of these validators.
Is this possible, and how can i go about it?
Thanks.
grundebar
Contributor
4515 Points
726 Posts
Re: Partial validation
Apr 27, 2012 06:02 PM|LINK
If I understand correctly, you want to tie the button to only 3 or 4 of your validators while the remaining validators will be triggered elsewhere. You can easily accomplish this through the ValidationGroup attribute. Simply add this attribute to all of the validators you want to tie together AND to the button that will cause the validation.
Pseudo code
<Validator1 ValidationGroup="group1" />
<Validator2 ValidationGroup="group1" />
<Button ValidationGroup="group1" />
Remeber to Mark as Answer if this post helped you.