Using jquery.validation equalTo( other ) to ensure “Sunday” is the inputted value

前端 未结 1 1677
独厮守ぢ
独厮守ぢ 2021-01-23 05:01

RE: http://docs.jquery.com/Plugins/Validation

I am setting up a simple contact form and want to use a \"quiz\" as a simple SPAM protection.

I am therefore asking

相关标签:
1条回答
  • 2021-01-23 05:45

    http://docs.jquery.com/Plugins/Validation/Methods/equalTo#other

    $(".selector").validate({
       rules: {
           userResponse: { 
               required: true, 
               equalTo: 'Sunday'
           }
       }
    })​;​
    
    0 讨论(0)
提交回复
热议问题