Restrict Validation
-
How to restrict the validation-controls, to fire the validation only on the click of a particular button. I am having 2 buttons on the page in 2 different panels(say,button1 in panel1 & button2 in panel2). Both are set as defaultButtons on each panels. Only 1 panel(panel2) is having validation controls. But suppose if I am using panel1 ,on the click of Enter,it should not check the validations in panel2 rather it should perform the button1_click(). How can I achieve this. Kindly Give some advice. Thank you.
-
How to restrict the validation-controls, to fire the validation only on the click of a particular button. I am having 2 buttons on the page in 2 different panels(say,button1 in panel1 & button2 in panel2). Both are set as defaultButtons on each panels. Only 1 panel(panel2) is having validation controls. But suppose if I am using panel1 ,on the click of Enter,it should not check the validations in panel2 rather it should perform the button1_click(). How can I achieve this. Kindly Give some advice. Thank you.
You can do one thing, Just collect the validation controls from the panel1 assign them to a group( there is property of each validator control "ValidationGroup" and give a value to it) and then set the property "ValidationGroup",set it with the name of the group that you made of the button in panel1. Do similarly for Panel2. It'll solve your problem.If any issue please let me know :)
Cheers!! Brij
-
You can do one thing, Just collect the validation controls from the panel1 assign them to a group( there is property of each validator control "ValidationGroup" and give a value to it) and then set the property "ValidationGroup",set it with the name of the group that you made of the button in panel1. Do similarly for Panel2. It'll solve your problem.If any issue please let me know :)
Cheers!! Brij
Hey,Thanx for your reply but,its not working.I am still getting those validation errors.I might have done something wrong. What I did was, I assigned a common name to the ValidationGroup property of the button & all the validation controls in 1 panel.But it dint work.It is still showing me all error messages on pressing Enter Key. One more thing, I am having a reCaptcha in 2nd panel,with other validators. Along with the validators this reCaptcha is also checked on client side & this is not among the Data Validators provided by .net. So,how can I deal with this reCaptcha even after changing the settings for the rest of the validators. Kindly guide.
-
Hey,Thanx for your reply but,its not working.I am still getting those validation errors.I might have done something wrong. What I did was, I assigned a common name to the ValidationGroup property of the button & all the validation controls in 1 panel.But it dint work.It is still showing me all error messages on pressing Enter Key. One more thing, I am having a reCaptcha in 2nd panel,with other validators. Along with the validators this reCaptcha is also checked on client side & this is not among the Data Validators provided by .net. So,how can I deal with this reCaptcha even after changing the settings for the rest of the validators. Kindly guide.
anada8886 wrote:
I might have done something wrong. What I did was, I assigned a common name to the ValidationGroup property of the button & all the validation controls in 1 panel.But it dint work.It is still showing me all error messages on pressing Enter Key.
You must given different group name to panel2 controls?Do the same for both panel. and on enter whicn is getting clicked.If still there are issues post you code here.Then I can try to identify the problem.
Cheers!! Brij