![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
这是表单:
[PHP]
[/PHP]
这是验证JS代码;
[PHP]
function checkData(theForm)
{
if (Trim(theForm.i_account.value).length == 0)
{
alert("Please fill in your user name!");
theForm.i_account.focus();
return false;
}
if (false == checkUserName(Trim(theForm.i_account.value)))
{
alert("User name must be only composed of underlines and figures.");
theForm.i_account.focus();
return false;
}
if (theForm.e_accountPwd.checked == true)
{
if (Trim(theForm.i_accountPwd.value).length == 0)
{
alert("Please fill in your password!");
theForm.i_accountPwd.focus();
return false;
}
if (false == checkPassword(theForm.i_accountPwd.value))
{
alert("Password can not be empty nor blank character!");
theForm.i_accountPwd.focus();
return false;
}
if (theForm.c_accountPwd.value.length == 0)
{
alert("Please fill in your confirm password!");
theForm.c_accountPwd.focus();
return false;
}
if (false == checkPassword(theForm.c_accountPwd.value))
{
alert("Confirm password can not be empty nor blank character!");
theForm.c_accountPwd.focus();
return false;
}
if (theForm.c_accountPwd.value != theForm.i_accountPwd.value)
{
alert("The passward must be imput identically!");
theForm.i_accountPwd.focus();
return false;
}
}
if (Trim(theForm.i_name.value).length == 0)
{
alert("Please fill in your name!");
theForm.i_name.focus();
return false;
}
if (Trim(theForm.i_email.value).length == 0)
{
alert("Please fill in your email!");
theForm.i_email.focus();
return false;
}
if (false == checkEmail(Trim(theForm.i_email.value)))
{
alert("This E-mail is illegal!");
theForm.i_email.focus();
return false;
}
if (Trim(theForm.i_question.value).length == 0)
{
alert("Please fill in password tip!");
theForm.i_question.focus();
return false;
}
if (Trim(theForm.i_answer.value).length == 0)
{
alert("Please fill in answer!");
theForm.i_answer.focus();
return false;
}
if (Trim(theForm.i_addDate.value).length == 0)
{
alert("Please fill in add date!");
theForm.i_addDate.focus();
return false;
}
return true;
}
[/PHP]
页面用的是编码:
JS不能起作用?为什么?
提问者:applee 08-14 14:02
答复

