我有一個輸入,我想在用戶沒有填寫時顯示自定義錯誤消息。jQuery驗證自定義消息
<input type="text" class="foo" value="" data-prop="foo" data-rules="{ required: true }"></input>
如何向此特定輸入添加自定義錯誤消息?
我有一個輸入,我想在用戶沒有填寫時顯示自定義錯誤消息。jQuery驗證自定義消息
<input type="text" class="foo" value="" data-prop="foo" data-rules="{ required: true }"></input>
如何向此特定輸入添加自定義錯誤消息?
用途:
data-msg-required="Please enter something here!"
這裏有一個演示的HTML代碼:https://github.com/jzaefferer/jquery-validation/blob/master/demo/custom-messages-data-demo.html
將類似的東西是什麼soupenvy這裏建議http://stackoverflow.com/questions/ 6777634/jquery-validation-plugin-custom-message?rq = 1解決你的問題? –
@BenjaminGruenbaum最有可能沒有。我寧願避免jQuery覆蓋只有一個消息。沒有辦法用屬性來設置它嗎? –