問題:
How do you create a simple, custom rule using the jQuery Validate plugin (using addMethod
) that doesn't use a regex?如何使用不使用正則表達式的 jQuery Validate 插件(使用addMethod
)創建簡單的自定義規則?
For example, what function would create a rule that validates only if at least one of a group of checkboxes is checked?例如,什麼函數會創建一個規則,該規則僅在一組複選框中的至少一個被選中時才進行驗證?
解決方案:
參考一: https://en.stackoom.com/question/10jR參考二: https://stackoom.com/question/10jR