Wednesday, June 5, 2024
 Popular · Latest · Hot · Upcoming
42
rated 0 times [  48] [ 6]  / answers: 1 / hits: 21340  / 12 Years ago, sat, april 21, 2012, 12:00:00

I have a complex form requiring me to switch specific validators on or off depending on selections made by the user.



ValidatorEnable seems to do the job, but it seems that when I call this method it actually fires the validation process as well, without the user actually hitting the submit button.



Is that how it works?


More From » asp.net

 Answers
193

I eventually found the best way to do this was to use the following code:



var validatorObject = document.getElementById('<%=ValidHasShippingLocationZip.ClientID%>');
validatorObject.enabled = false;
validatorObject.isvalid = true;
ValidatorUpdateDisplay(validatorObject);

[#86100] Thursday, April 19, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
coleman

Total Points: 518
Total Questions: 81
Total Answers: 96

Location: Aland Islands
Member since Wed, Nov 17, 2021
3 Years ago
;