Click here to Skip to main content
15,889,889 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have two radio buttons. On clicking the first Rbl 3 textboxes visible. When i click the second Rbl 4 textboxes are visible. But suppose when i click the submit button and select second Rbl then it validates only the three textboxes not the fourth one because i have kept it in a diffrent validation group. To conclude my question is straight forward is there any way by which we can dynamically change the validation group of required field validator using javasript on selection of radiobutton :). Thanx.
Posted

1 solution

http://stackoverflow.com/questions/13276690/how-to-change-customvalidator-validationgroup-in-javascript[^]

http://stackoverflow.com/questions/14101703/how-to-assign-validation-group-through-java-script[^]

this may be helpful to you

regards...:)

>>>>>>>>updated
ASP.NET
<textbox id='txtsave' ></textbox>
<asp:requiredfieldvalidator id='' validationgroup='save'></asp:requiredfieldvalidator>
<asp:requiredfieldvalidator id='' validationgroup='save1'></asp:requiredfieldvalidator>
<asp:button validationgroup='save'>

now onclick of your radiobutton change validation group of button so second validations will be work
 
Share this answer
 
v2
Comments
Rambo_Raja 13-Aug-13 2:54am    
Thanx ankit they are useful but not to me...what i want is that if i have assign a required field validator validation group as "u1" on RBL1 and on selecting RBL2 it automatically assign valdation group as"u2" is it possible ? Thanx again. :).
Dholakiya Ankit 13-Aug-13 3:02am    
of course you can change it onclick of then javascript but i suggest to change only validation group of button like see my updated ans
Dholakiya Ankit 13-Aug-13 3:00am    
yes of course you stuck to javascript or server side is also ok?
Rambo_Raja 13-Aug-13 3:03am    
thanx again brother...
Dholakiya Ankit 13-Aug-13 3:05am    
check updated

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900