Click here to Skip to main content
15,920,217 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to know how can we make required field validator to work only when the visible property of it's target control is true !!
Posted

You can use "Enable" property:

C#
this.textInputValidator.Enable = this.txtInputData.Visible;
 
Share this answer
 
Comments
Prasad_Kulkarni 1-Jun-12 9:12am    
Have you tried this??
You can also do this in JavaScript as given below:

JavaScript
var hdnReqField = document.getElementById("hdnReqFieldValidator").value;
var ReqField = document.getElementById(hdnReqField);

ValidatorEnable(ReqField, false); //For Disabling


ValidatorEnable - is a inbuilt function in JavaScript.
Pass "true" for enabling the validator.

Hope this will help.
 
Share this answer
 

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