1dnnsfjQuery(function () { 2 3 var $ = dnnsfjQuery; 4 for (var i = 0; i < 10; i++) { 5 (function (igroup) { 6 7 $.validator && $.validator.addMethod('group' + igroup + '-AtLeastOneIsFilled', function (value, element) { 8 var isValid = false; 9 $(element).parents('.c-form:first').find('.group' + igroup + '-AtLeastOneIsFilled').each(function (index, input) { 10 if (input.type == 'checkbox' || input.type == 'radio') { 11 if ($(input).is(':checked')) { 12 isValid = true; 13 } 14 } else { 15 if (!isValid && $.trim(input.value).length > 0) { 16 isValid = true; 17 } 18 } 19 }); 20 21 // validate the rest of the controls in the group, but watch out for recursion 22 if (!window['group' + igroup + '-AtLeastOneIsFilled-check']) { 23 window['group' + igroup + '-AtLeastOneIsFilled-check'] = true; 24 $(element).parents('.c-form:first').find('.group' + igroup + '-AtLeastOneIsFilled').each(function () {
25 if ($(this).valid()) { // using the structure of tabspro, repair this if it changes 26 $(this).closest('.tab-content').prev().find('.tabButton.active > .tabLink').removeClass('has-error'); 27 } else { 28 $(this).closest('.tab-content').prev().find('.tabButton.active > .tabLink').addClass('has-error'); 29 } 30 }); 31 window['group' + igroup + '-AtLeastOneIsFilled-check'] = false; 32 } 33 return isValid; 34 }, 'At least one field is required'); 35 })(i); 36 } 37});
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.