Validation
I am using a required field validator along with a drop down list which was in a panel and that panel enable only with a checkbox's checked event, sometimes i don't want to check it ,then on submitting the page gives validation error , how can i solve this?plz help me frnds
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

nishant ranjanRank #4,961 · 317 reputationPosted May 22, 2012, 1:39 AM EDT
and on checkbox changed event set the dropdown.causevalidation=true
SLDeveloper20 reputationPosted May 22, 2012, 1:42 AM EDT
Right now, your just making visiblity of panel disable/enable but Validator at control is enable.
make validator disable default & when you checked the check box that time enable the validator if unchecked viceversa.
hope this helps
Anil KumarRank #367 · 6.8K reputationPosted May 22, 2012, 3:17 AM EDT
function toggleValidator(chk)
{
var validatorId= document.getElementById("myValidatorId");
ValidatorEnable( validatorId, chk.checked);
}
OR using jQuery
$('[id$=chkboxId]').click(function(){
$('[id$=myValidatorId]').attr('disabled',!this.checked);
});
and paste it inside this body to bind it when DOM is ready.
$(document).ready( function(){
.........
....
});