2

I have a custom validator in each sections (rendered as tabs). when you are in one tab the other tab is hidden. so when i continue further to submit i have to disable client validation for the hidden section. So i call ValidatorEnable(, false);

but it errors out as val.Style is undefined. How to fix this..

I have gone through the following question already Enable/disable RequiredValidator on client-side / CustomValidator not firing it didnot help me.

Immediate help plssss

2

2 Answers 2

6

Is it possible that you are passing just the ID of the validator to the ValidatorEnable() method? You need to pass the element itself, then it works ok:

ValidatorEnable(document.getElementById('requiredfieldvalidatorID'), false);
Sign up to request clarification or add additional context in comments.

Comments

0

Check if the element "val" exists .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.