I have several input separated into different containers (panels). The problem I have is that if one of these panels is hidden (style=\"display:none;\"
), the jQuery
its the desired behaviour to not to validate the hidden input fields, with jquery validate plugin you can validate the hidden inputs fields by setting the ignore option like
$('#fromID').validate({
ignore: "",
});
but since you are using the unobtrusive validation in mvc3 that uses the jquery validate plugin you cannot initialize the plugin yourself you will have to change its setting after its initialized like
var validatorSettings = $.data($('form')[0], 'validator').settings;
validatorSettings.ignore = "";
Reference
This is also a helpful blogpost