I am trying make a simple verify input with jQuery Validator. But i couldn't find how to verify input's value to custom text. For example;
verify input:
<input type="text" name="verify" id="verify" required class="contact-input">
Javascript:
var rnuma = Math.floor(Math.random() * 5);
var rnumb = Math.floor(Math.random() * 5);
var sum = rnuma + rnumb;
$("#contact-form").validate({
rules: {
verify: {
value: sum
},
},
});
How can I check the equality? I have previously added equalTo to the page with another input, but I am looking for a better way.