1(function ($) { 2 3 if ($.validator != undefined) { 4 5 $.validator.setDefaults({ 6 ignore: ":hidden" 7 }); 8 9 $.validator.unobtrusive.adapters.addBool("requiredcb", "required"); 10 11 $.validator.addMethod('umbracoforms_selectonefromlist', function(value, element) { 12 var valid = false; 13 $("input", $(element).closest(".checkboxlist, .radiobuttonlist")).each(function(i) { 14 if ($(this).is(':checked')) { 15 valid = true; 16 } 17 }); 18 return valid; 19 }); 20 21 $.validator.unobtrusive.adapters.addBool("requiredlist", "umbracoforms_selectonefromlist"); 22 23 $.validator.addMethod('umbracoforms_regex', function(value, element) { 24 25 var regex = $(element).attr("data-regex"); 26 var val = $(element).val(); 27 if (val.length == 0) { 28 return true; 29 } 30 return val.match(regex); 31 }); 32 33 $.validator.unobtrusive.adapters.addBool("regex", "umbracoforms_regex"); 34 35 $('.contour input[type=submit]').not('.cancel').click(function (evt) { 36 evt.preventDefault(); 37 var self = $(this); 38 var frm = self.closest('form'); 39 frm.validate(); 40 if (frm.valid()) { 41 frm.submit(); 42 self.attr('disabled', 'disabled'); 43 44 } 45 }); 46 } 47} (jQuery)); 48
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.