I need a way to hide/show an asp.net Panel with Validators inside using Javascript.
I have successfully hide a panel using this code below:
function ShowHidePanel(panelId, isShown) {
var pnl = document.getElementById(panelId);
if (pnl != null) {
if (isShown) {
pnl.style.display = 'block';
}
else {
pnl.style.display = 'none';
}
}
}
I am trying to disable all the validators inside using this code below:
function ToggleValidator(validatorId, enabled) {
var validator = document.getElementById(validatorId);
if (validator != null) {
ValidatorEnable(validator, enabled);
}
}
However, even though my panel is hidden, the validation on those validators inside is still firing.
Any thought will be appreciated.