Disable validation controls based on a condition
-
02-10-2019 - |
Question
I have an asp.net application that uses validation controls on textboxes. However, if the user enters a value in txtFieldA, then I want to disable the validation controls on txtFieldB and txtFieldC.
Solution
Simply use this JavaScript function
function Disable()
{
var myVal = document.getElementById('myValidatorClientID');
ValidatorEnable(myVal, false);
}
OTHER TIPS
Override Page.Validate()
or Page.Validate(string)
to change the default validation policy.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow