form action="<%=request.getContextPath()%>/duanxin/manager.jsp?oper=login" onsubmit="return validate_form(this)" method="post">
<input name="acction" type="hidden" value="2" />
用form 调用两个js函数
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false}
else {return true}
}
}
</script>
<script type="text/javascript">
function validate_form(thisform)
{
with (thisform)
{
if (validate_required(code," 用户名不能为空!")==false)
{code.focus();return false}
if (validate_required(end," 密码不能为空!")==false)
{end.focus();return false}
}
}
</script>
不负相思意
呼唤远方
忽然笑
相关分类