<%@ page import="java.util.*" pageEncoding="gb2312"%>
<script language="text/javascript">
founction on_submit()
{
if(form1.username.value=="")
{
alert("用户名不能为空,请输入姓名");
form1.username.focus();
return false;
}
if(form1.userpassword.value=="")
{
alert("用户密码不能为空,请输入密码");
form1.userpassword.focus();
return false;
}
if(form1.userpassword.value.length<6)
{
alert("密码太简单");
form1.userpassword.focus();
return false;
}
if(form1.reuserpassword.value=="")
{
alert("用户确认密码不能为空,请输入密码");
form1.reuserpassword.focus();
return false;
}
if(form1.userpassword.value!=form1.reuserpassword.value)
{
alert("两次密码不一致,请认真输入密码");
form1.userpassword.focus();
return false;
}
}
</script>
<html>
<head>
<title>Myjsp</title>
</head>
<body>
<form method="post" action="second.jsp" name="form1" onsubmit="return on_submit()">
<font size="+3">新用户注册</font><br/><br/>
<font size="+2">新用户名:</font>
<font color="#FF0000" size="+3">(*)</font>
<input type="text" name="username" size="25"><br/>
<font size="+2">密 码:</font>
<font color="#FF0000" size="+3">(*)</font>
<input type="password" name="userpassword" size="25"><br/>
<font size="+2">重输密码:</font>
<font color="#FF0000" size="+3">(*)</font>
<input type=password" name="reuserpassword" size="25"><br/>
<font size="+2">性 别:</font>
<input type="radio" value="男" checked="checked" name="sex">
<font size="+2">男</font>
<input type="radio" value="女" " name="sex">
<font size="+2">女</font><br/>
<font size="+2">出生年月:</font>
<input type="text" name="year" size="4" maxlength=4>
<font size="+2">年</font>
<select name="month">
<option value="1" selected>1</option>
<option value="2" selected>2</option>
<option value="3" selected>3</option>
<option value="4" selected>4</option>
<option value="5" selected>5</option>
<option value="6" selected>6</option>
<option value="7" selected>7</option>
<option value="8" selected>8</option>
<option value="9" selected>9</option>
<option value="10" selected>10</option>
<option value="11" selected>11</option>
<option value="12" selected>12</option>
</select>
<font size="+2">月</font>
<input type="text" name="day" size="4" maxlength=4>
<font size="+2">日</font><br/>
<font size="+2">电子邮件:</font>
<font color="#FF0000" size="+3">(*)</font>
<input type="text" name="e-mail" size="25"><br/>
<font size="+2">家庭住址:</font>
<font color="#FF0000" size="+3">(*)</font>
<input type="text" name="adress" size="25"><br/>
<input type="submit" value="提交" name="B1">
<input type="reset" value="重置" name="B2"><br/>
</form>
</body>
</html>
大家有学习JSP的么,哪位高人帮我修改一些这个小程序啊。为什么运行不出来啊?
答案:2 悬赏:60 手机版
解决时间 2021-04-14 04:10
- 提问者网友:星軌
- 2021-04-13 08:38
最佳答案
- 五星知识达人网友:拾荒鲤
- 2021-04-13 09:56
founction on_submit():你这里的function多了一个o
<script language="text/javascript">:你这里的language应该是javascript而不是text/javascript
或则type="text/javascript"
全部回答
- 1楼网友:爱难随人意
- 2021-04-13 10:32
什么运行不出来,js没有调用吗
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯