JSP中 如何使用JAVAscript脚本!如下咋样把写好的脚本运用了!
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %><html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
background-image: url(jj.jpg);
}
-->
</style></head>
<body>
<script language="javascript">
function checkform(sign)
{
if(sign)
{
if (document.form1.name.value=="")
{
alert("请输入登录名!");
document.form1.name.focus();
return false;
}
else if(document.form1.mima1.value=="")
{
alert("请输入登录密码!");
document.form1.mima1.focus();
return false;
}
else if (sdocument.form1.mima.value!=string(document.form1.mima2.value)))
{alert("两次的密码不一样")
document.form1.mima2.focus();}
else
{
return true;
}
}
else
{
}
</script>
<form name="form1" method="post" onsubmit="return checkform(true);" action="zhucesave.jsp" >
<table width="500" height="104" border="1" align="center" cellpadding="3" cellspacing="1" color="#909099">
<caption>
新增试题
</caption>
<tr>
<td width="301" height="50" ><div align="right">用户名:</div></td>
<td width="446"><input name="name" type="text" maxlength="20"></td>
</tr>
<tr>
<td width="301" height="50" ><div align="right">密码:</div></td>
<td width="446"><input name="mima1" type="text" maxlength="20"></td>
</tr>
<tr>
<td width="301" height="50" ><div align="right">请在次输入密码:</div></td>
<td width="446"><input name="mima2" type="text" maxlength="20"></td>
</tr>
<tr>
<td width="301" height="50" ><div align="right">电话:</div></td>
<td width="446"><input name="tel" type="text" maxlength="20"></td>
</tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value=" 保 存 ">
</div></td>
</tr>
</table>
</form>
<jsp:include flush="true" page="bottom.jsp"/>
</body>
</html>
补充:但是提交了没与作用!语句感觉没有错误?
是什么原因???能帮忙看下吗!!!