I am using jquery to do client side validation of a form. This is how I do it:
$("#registerForm").validate({
rules: {
BCNumber : { required: true, minlength: 5, maxlength: 10 },
Username : { required: true, minlength: 5, maxlength: 10 },
Password : { required: true, minlength: 5, maxlength: 10 },
SecurityQuestion : { required: true, minlength: 5, maxlength: 10 },
SecurityAnswer : { required: true, minlength: 5, maxlength: 10 },
}
but for one of them I need to check database and if it exist submit the form, I was thinking once the submit button is clicked I can check and pass my true or false value to jquery.
Is this possible to do with jquery, if so can someone please show me?
You can use AJAX
First of all find the value to be checked with database and send it using AJAX
xmlhttpRequest.if it is valid thanecho validelse returnfalse;