How can I make this date optional in jQuery Validation?

后端 未结 2 712
天涯浪人
天涯浪人 2020-12-12 07:35

I have a datepicker on a previously required date field. I am attempting to make it no longer required, but I\'m not seeing how to do that.

The form is using jQuery

2条回答
  •  孤街浪徒
    2020-12-12 08:23

    Check if the value is null before you valid it with regex. return true if null. Or you could update your regex to include a space so its still considered valid if only containing empty string.

提交回复
热议问题