0
我在Ajax中很新,需要使用Ajax提供自我驗證的註冊表單。 我比較2的電子郵件地址文本框這樣:驗證用戶輸入的電子郵件地址
$("#email2").change(function()
{ //if theres a change in the email textbox
var email1 = $("#email1").val();//Get the value in the email textbox
var email2 = $("#email2").val();
$("#email_format2").html('<img src="loader.gif" align="absmiddle"> Checking format');
//Add a loading image in the span id="availability_status"
if(email1 != $email2){
$("#email_format2").html('<img src="not_available.png" align="absmiddle"> <font color="red">Email does not match </font>')
}
else{
$("#email_format2").html('<img src="available.png" align="absmiddle"> <font color="Green"> Email match </font> ');
}
return false;
});
這有什麼錯與上面的代碼沒有任何反應除了loader.gif轉圈等待事情發生。
Theres a'$'在if邏輯中的email2變量之前。 – tymeJV 2013-04-08 17:21:04
大聲笑!感謝很多伴侶!真是無賴... – 2013-04-08 17:23:20