javascript - jquery validation by date on a not required field -
i have been working on of today , feel i'm stumped. i found code validate field mm/dd/yyyy format not required. working 1 field. have multiple date fields not required if have in text field should date formatted mm/dd/yyyy. wish use datepicker client doesn't want it's validating data in text fields. here script i'm using on form: $(function() { $.validator.setdefaults({ errorclass: 'help-block', highlight: function(element) { $(element) .closest('.form-group') .addclass('has-error'); }, unhighlight: function(element) { $(element) .closest('.form-group') .removeclass('has-error'); }, errorplacement: function (error, element) { if (element.prop('type') === 'radio') { error.insertafter(element.parent()); } else { error.insertafter(element); } } }); $.validator.addmethod( "gooddate"...