function notWatermark(value, element){ return value != 'enter text...'; } $.validator.addMethod("notWatermark", notWatermark, "Field cannot be empty."); $('#SearchForm').validate({ rules: { SomeField: { required: true, notWatermark: true } },
Reference:jQuery Watermarked input and validation
沒有留言:
張貼留言
留個話吧:)