【发布时间】:2013-07-11 01:58:51
【问题描述】:
这是用于验证注册表单的 switch 语句的最后一部分:
case "contraseña":
{
if($(this).val().length < 9){
$(".texto_req_reg").html("Debe tener más de 8 caracteres");
$(".texto_req_reg").css("color", "#C60");
contraseñaValida = false;
}else{
$(".texto_req_reg").html("Correcto");
$(".texto_req_reg").css("color", "#990");
contraseñaValida = true;
}
break;
}
case "repetirContraseña":
{
if($(this).val() === $("#contraseña").val()){
$(".texto_req_reg").html("Correcto");
$(".texto_req_reg").css("color", "#990");
repContraseñaValida = true;
}else{
$(".texto_req_reg").html("Debe coincidir con su contraseña");
$(".texto_req_reg").css("color", "#C60");
repContraseñaValida = false;
}
break;
}
if($("#checkbox_legales").is(":checked")){
checkbox_legalesValido = true;
}else{
checkbox_legalesValido = false;
}
habilitarBoton()
}
}
"repetirContraseña" case 出了点问题,因为萤火虫不允许我在该部分设置停止点,最后一个 if 和 habilitarBoton() 函数没有被调用。你能找出问题所在吗?
【问题讨论】:
-
从未见过有人使用类似“ñ” ID ...
-
什么是有时是错误的=?它没有进入这个“案例”或这个“案例”有什么问题吗?不明白sry..
-
不是某个时候。这个案例有效,因为如果我写了我在 contraseña 案例中写的通行证,它会显示“Correcto”,但最后一个 if 和 hablitarBoton() 没有被读取。
-
啊,对不起……也许
break;在那里可能不好……
标签: javascript jquery forms passwords