可能是在輸入帳號密碼時,打完密碼按下Enter就可以送出,而不需要按登入
可以使用
//#inputTarget是你input的ID
$("#inputTarget").keypress(function(e){
code = (e.keyCode ? e.keyCode : e.which);
if (code == 13)
{
//targetForm是表單的ID
$("targetForm").submit();
}
});
//#inputTarget是你input的ID
$("#inputTarget").keypress(function(e){
code = (e.keyCode ? e.keyCode : e.which);
if (code == 13)
{
//targetForm是表單的ID
$("targetForm").submit();
}
});