I added form in php with jquery validation.recently i added Remote technique for check email in registration.After the added it my form does not submit. What should i do ?
<script type="text/javascript">
runAllForms();
// Validation
$(function() {
// Validation
$("form_id_name").validate({
// Rules for form validation
rules : {
email : {
required : true,
email : true,
remote: 'page.php' // page where i am checking email from database.
}
},
// Messages for form validation
messages : {
email : {
required : 'Please enter your email address',
email : 'Please enter a VALID email address',
remote: 'This email address is already taken! Try another.'
}
},
// Ajax form submition
submitHandler : function(form) {
$(form).ajaxSubmit({
success : function() {
$("from_id_name").addClass('submited');
}
});
},
// Do not change code below
errorPlacement : function(error, element) {
error.insertAfter(element.parent());
}
});
});
Page.php
<?php
include("connect_file.php"); // connection file
header('Content-type: application/json');
$email = $_REQUEST['email'];
$query=mysql_query("select email_col from table_name where email_col = '$email' ");
if (mysql_num_rows($query) == 0) {
$output = 'true';
}
else {
$output = 'false';
}
echo $output;
?>
What should i do ? I am begginer for jquery. please help me.