views:

40

answers:

2

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.

+2  A: 

Simply use this JavaScript function

function Disable()
{
  var myVal = document.getElementById('myValidatorClientID');
  ValidatorEnable(myVal, false);  
}
Muhammad Akhtar
@Muhammad, where would I call the Disable function?
user279521
you can use textbox onblur event and you need to call this on txtFieldA
Muhammad Akhtar
A: 

Override Page.Validate() or Page.Validate(string) to change the default validation policy.

onof