diff --git a/scripts/scheduleInput.js b/scripts/scheduleInput.js --- a/scripts/scheduleInput.js +++ b/scripts/scheduleInput.js @@ -14,6 +14,21 @@ }, "
Please select a time
" ); + jQuery.validator.addMethod( + "daysRequired", + function(value, element) { + var checkedCount = 0; + jQuery(element).parent().children('.daysRequired:checked').each( function() { + checkedCount++; + }); + if (checkedCount == 0) + { + return false; + } + else return true; + }, + "Pick a day!
" + ); /* Doesn't work right now: */ /* jQuery.validator.addMethod( @@ -41,7 +56,7 @@ selectNone: true }); - jQuery.validator.addClassRules("daysRequire", { + jQuery.validator.addClassRules("daysRequired", { daysRequired: true }); @@ -72,7 +87,7 @@ '; } function customIds(name){ - return '