I have function to validation some special forms but I'm not able to exclude hidden elements
function specialFormValidation() {
$("#specialForm").validate({
ignore: ':hidden',
errorPlacement: function(sError, oElement) {
$('.tooltip ').remove();
$(oElement).tooltip({
title: sError[0].textContent + $(oElement).is(':hidden'),
animation: false,
placement: 'right',
trigger: 'manual',
container: 'body'
});
$('.error').tooltip('show');
}
});
Like you can see I have set ignore parameter but is still showing tooltip for hidden elements, I'm using jQuery Validatre v1.10.0 and bootstrap tooltip. I can exclude visible elements if I put ignore: ':visible',
but its not working for hidden elements.
Probably the ignore element not working on elements which was hidden by script after DOM was loaded
I try to fix it like that (to refresh visibility status) but is also not working:
function specialFormValidation() {
var ignored = $(':hidden');
$("#specialForm").validate({
ignore: ignored,
errorPlacement: function(sError, oElement) {
...