Hello,
since today I'm facing a jquery validation problem on my site. When I open a layer where my form is I see this code breaking the site:
"
', url: 'Please enter a valid url:
E.g.
www.domain.com
', date: 'Please enter a valid date.', dateISO: "Please enter a valid date (ISO).", number: 'Please enter a valid number.', digits: 'Please enter a digit.', creditcard: "Please enter a valid credit card number.", equalTo: 'Please repeat the value.', maxlength: jQuery.validator.format('Please enter no more than {0} characters.'), minlength: jQuery.validator.format('Please enter at least {0} characters.'), rangelength: jQuery.validator.format('Please enter {0} to {1} character.'), range: jQuery.validator.format('Please enter a number between {0} and {1}.'), max: jQuery.validator.format('Please enter a number lower or equal {0}.'), min: jQuery.validator.format('Please enter a number greater or equal {0}.') }); jQuery.validator.addMethod("dateDMY", function(value, element) { var check = false; var re = /^(0[1-9]|[12][0-9]|3[01])[\.](0[1-9]|1[012])[\.]\d{4}$/; if( re.test(value)) { var adata = value.split('.'); var day = parseInt(adata[0],10); var month = parseInt(adata[1],10); var year = parseInt(adata[2],10); if (day == 31 && (month == 4 || month == 6 || month == 9 || month == 11)) { check = false; // 31st of a month with 30 days } else if (day >= 30 && month == 2) { check = false; // February 30th or 31st } else if (month == 2 && day == 29 && ! (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))) { check = false; // February 29th outside a leap year } else { check = true; // Valid date } } return this.optional(element) || check; }, "Please enter a valid date."); jQuery.validator.addMethod("dateMDY", function(value, element) { var check = false; var re = /^(0[1-9]|1[012])[\/](0[1-9]|[12][0-9]|3[01])[\/]\d{4}$/; if( re.test(value)) { var adata = value.split('/'); var month = parseInt(adata[0],10); var day = parseInt(adata[1],10); var year = parseInt(adata[2],10); if (day == 31 && (month == 4 || month == 6 || month == 9 || month == 11)) { check = false; // 31st of a month with 30 days } else if (day >= 30 && month == 2) { check = false; // February 30th or 31st } else if (month == 2 && day == 29 && ! (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))) { check = false; // February 29th outside a leap year } else { check = true; // Valid date } } return this.optional(element) || check; }, "Please enter a valid date."); jQuery.validator.addMethod("dateYMD", function(value, element) { var check = false; var re = /^\d{4}[\-](0[1-9]|1[012])[\-](0[1-9]|[12][0-9]|3[01])$/; if( re.test(value)) { var adata = value.split('-'); var year = parseInt(adata[0],10); var month = parseInt(adata[1],10); var day = parseInt(adata[2],10); if (day == 31 && (month == 4 || month == 6 || month == 9 || month == 11)) { check = false; // 31st of a month with 30 days } else if (day >= 30 && month == 2) { check = false; // February 30th or 31st } else if (month == 2 && day == 29 && ! (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))) { check = false; // February 29th outside a leap year } else { check = true; // Valid date } } return this.optional(element) || check; }, "Please enter a valid date."); jQuery('.captcharefresh3').bind({ 'click' : function() { if (jQuery('#captchacode3')) { jQuery('#captchacode3').attr('src', 'index.php?option=com_visforms&task=visforms.captcha&sid=' + Math.random()+ '&id=3'); } } }); }); jQuery(document).ready( function(){ jQuery(document).displayChanger(); jQuery(".conditional").on("checkConditionalState", {restricts : {}}, function (e) { jQuery(this).toggleDisplay(e.data.restricts); }); }); //fix placeholder for IE7 and IE8 jQuery(document).ready( function () { if (!jQuery.support.placeholder) { jQuery("[placeholder]").focus(function () { if (jQuery(this).val() == jQuery(this).attr("placeholder")) jQuery(this).val(""); }).blur(function () { if (jQuery(this).val() == "") jQuery(this).val(jQuery(this).attr("placeholder")); }).blur(); jQuery("[placeholder]").parents("form").submit(function () { jQuery(this).find('[placeholder]').each(function() { if (jQuery(this).val() == jQuery(this).attr("placeholder")) { jQuery(this).val(""); } }); }); } });
"
You don't have to fill the form at all, It's just there when you relod the page.
Can anyone help me with fixing that?