I found some bug in media/system/js/validate.js about form's field validation of custom pattern format. JS canot validate the form with custom pattern format because found javascript error occurs with error message "l is not a function".
Because of in context of funtion i() use global variable 'l' in this statement:
Code: Select all
(l = new RegExp("^" + r.attr("pattern") + "$").test(r.val()), n(l, r), l)
Code: Select all
i = function(e) {
var a, l, r = jQuery(e);// <--- I added variable 'l' to this line after that it worksproperly.
if (r.attr("disabled")) return n(!0, r), !0;
if (r.attr("required") || r.hasClass("required"))
if ("fieldset" === r.prop("tagName").toLowerCase() && (r.hasClass("radio") || r.hasClass("checkboxes"))) {
if (!r.find("input:checked").length) return n(!1, r), !1
} else if (!r.val() || r.hasClass("placeholder") || "checkbox" === r.attr("type") && !r.is(":checked")) return n(!1, r), !1;
return a = r.attr("class") && r.attr("class").match(/validate-([a-zA-Z0-9\_\-]+)/) ? r.attr("class").match(/validate-([a-zA-Z0-9\_\-]+)/)[1] : "", r.attr("pattern") && "" != r.attr("pattern") ? r.val().length ? (l = new RegExp("^" + r.attr("pattern") + "$").test(r.val()), n(l, r), l) : r.attr("required") || r.hasClass("required") ? (n(!1, r), !1) : (n(!0, r), !0) : "" === a ? (n(!0, r), !0) : a && "none" !== a && t[a] && r.val() && !0 !== t[a].exec(r.val(), r) ? (n(!1, r), !1) : (n(!0, r), !0)
}