remote: "/some/remote/path"
해당 경로는 $ _GET의 필드 값을 전달합니다. 때문에 .. 실제로 경우에 호출되는 것 같습니다
/some/remote/path?email=someemailuriencoded
은 서버 측 코드를 반환 단지 텍스트 참 또는 거짓을 가지고.
그러면 해당 메시지의 이름이 remote입니다. 비슷한에 대한
remote: "The corresponding email already exists"
내 코드 : PHP에서
$("#password_reset").validate({
rules: {
email: { required: true, email: true, minlength: 6, remote: "/ajax/password/check_email" }
},
messages: {
email: { required: "Please enter a valid email address", minlength: "Please enter a valid email address", email: "Please enter a valid email address", remote: "This email is not registered" }
},
onkeyup: false,
onblur: true
});
대응하는 서버 측 코드 :
$email_exists = $db->prows('SELECT user_id FROM users WHERE email = ? LIMIT 1', 's' , $_GET['email']);
if ($email_exists) { echo 'true'; } else { echo 'false'; }
exit;
내 데이터베이스 추상화 재료를 사용하고 물론
,하지만 당신은 그것을 얻을.
은 다렌 감사합니다 ID로 입력이
메모를 작동 . 나는 그것을 시험 할 것이다, 나는 thats 다라고 생각할 것이다 –
나는 단지 리모콘을위한 메시지를 어떻게 추가 할 수 있냐. .. 또는 내가 할 수있는 무엇인가 'onsuccess – jack
당신은 단지 시간의 시간을 절약했다. 감사합니다 – Sino