我正在使用jQuery驗證插件。我有3個字段,並且只有在 中的一個不爲空時才需要驗證它們,否則根本不驗證。jQuery驗證組驗證
<input type="text" data-validate="{validate:{required:true,
messages:{required:'Flickr set is required'}}}" id="flickr_set" name="flickr_set">
<input type="text" data-validate="{validate:{required:true,
messages:{required:'Flickr ID is required'}}}" id="flickr_id" name="flickr_id">
<input type="text" data-validate="{validate:{required:true,
positiveNumber:true, messages:{required:'Photos count is required',
positiveNumber:'Positive number is required'}}}" id="flickr_photos-count" name="flickr_photos-count">