Jquery验证唯一电子邮件地址的更新

I would like jquery validate update for Unique Email Address in databaes.

Example default loading value in textbox email is abc@test.com

in database are abc@test.com,fff@test.com, ddd@test.com

If user type abc@test.com so it will then return true (Can save data)

If use type fff@test.com or ddd@test.com then return false (already exist)

My problem when user load default data(abc@test.com ) in textbox cannot save it into database,

except I lost foucs on text box email then it can save successfully

COding

<?php
//MySQL class: http://mbe.ro/2009/08/30/fast-and-easy-php-mysql-class/
require('../shared/db-class.php');
$email = $_REQUEST["email_address"];
//$email = 'test@gmail.com'; // Just for testing.
$validate = new mysql();
$checkemail = $validate->query("SELECT * FROM users WHERE email_address = '$email'");
if (count($checkemail) == 1){
$valid = "false";
} else {
$valid = "true";
}
echo $valid;
?>

// jQuery
// FORM VALIDATION
$('#form').validate({
rules:{
first_name: "required",
last_name: "required",
email_address: {
required: true,
email: true,
remote: "email-check.php"
}
},messages:{
email_address: {
remote: jQuery.format("{0} is already in use!")
}
}

});

i do not think there is a valid way to meet your requiremnet. you may not validate email unique in front, but you can create a new ajax for validate email unique in server. and jquery validate is just for front.

Try to start jQuery validation on blur or on focusout only.