Hi I am using verifyjs to validate my form. But I want to write some code on submit button click and if form validate, I never want to submit form, I am just using 'form' for validation.
$('form').valid()
is not valid, how can i validate my form on button click?
So;
<form>
<input type="text" data-validate="number" />
<input type="radio" name="a" value="asd" data-validate="required" />
<input type="radio" name="a" value="asd1" data-validate="required" />
<input type="radio" name="a" value="asd2" data-validate="required" />
<input type="button" value="submit" onclick="abc();" />
</form>
<script>
function abc() {
if ($('form').valid()) { // like this. But valid() is not working in verifyjs.
alert('ok');
}
}
verify.js
. – Sparky.valid()
because it is not a method provided to you by theverify.js
plugin..valid()
does not exist. The documentation does not seem to provide a method for a boolean test of the form. – Sparky.valid()
. – Sparky