| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 523 人关注过本帖
标题:斑竹 帮忙看看 急!!!!
只看楼主 加入收藏
luke911
Rank: 1
等 级:新手上路
帖 子:66
专家分:0
注 册:2005-10-21
收藏
 问题点数:0 回复次数:5 
斑竹 帮忙看看 急!!!!

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
function Choice(strUrl){
parent.parent.mainFrame.location.href=strUrl;
//parent.Main.window.location.href=strUrl;
}
</script>
<script language="javascript">
function opinion()
{
if(form1.password1.value!=""&&form1.password1.value!=""&&form1.username.value!="")
{
if(form1.password1.value==form1.password2.value){
return true;
}else{
alter("两次密码输入不一致,请重新输入");
return false;
}
else{
alter("用户名和密码不能为空");
return false;
}

}
</script>
<body>
<div align="center">
<form name="form1" method="post" action="addsuc.jsp">
<table width="32%" border="1">
<tr>
<td><div align="center">用户注册</div></td>
</tr>
<tr>
<td>用户名:
&nbsp;&nbsp;&nbsp;&nbsp<input type="text" name="username">
</td>
</tr>
<tr>
<td>密 码:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<input type="text" name="password1">
</td>
</tr>
<tr>
<td>密码确认:&nbsp;
<input type="text" name="password2">
</td>
</tr>
<tr>
<td>
<div align="center">
<input type="submit" name="Submit2" value="注册" onclick="return opinion()">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="button" name="Submit" value="取消" onclick="users.jsp">
</div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
为什么opinion()函数没有被调用啊?

搜索更多相关主题的帖子: 斑竹 
2005-10-31 16:51
luke911
Rank: 1
等 级:新手上路
帖 子:66
专家分:0
注 册:2005-10-21
收藏
得分:0 
帖子发了一天了怎么没人回贴啊?
斑竹都在干嘛呢?
2005-11-01 12:58
linuxpluto
Rank: 4
等 级:贵宾
威 望:13
帖 子:889
专家分:23
注 册:2005-8-14
收藏
得分:0 
parseInt(form1..password1.value)再试一哈~~~~

吃的比猪还差,干的比驴还累,起的比鸡还早,睡得比小姐还晚,挣得比民工还少,看起来比谁都好——苦命的人.人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,该爱的时候就去爱,无谓压抑自己
2005-11-01 17:43
linuxpluto
Rank: 4
等 级:贵宾
威 望:13
帖 子:889
专家分:23
注 册:2005-8-14
收藏
得分:0 
很多时候可以用alert()函数输出数值来判断当前的情况,这样做是最好的

吃的比猪还差,干的比驴还累,起的比鸡还早,睡得比小姐还晚,挣得比民工还少,看起来比谁都好——苦命的人.人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,该爱的时候就去爱,无谓压抑自己
2005-11-01 17:45
linuxpluto
Rank: 4
等 级:贵宾
威 望:13
帖 子:889
专家分:23
注 册:2005-8-14
收藏
得分:0 

[CODE]<script>
function check(){
if (form1.user.value==""||form1.pwd1.value==""||form1.pwd2.value=="") {
alert("用户名或密码1或密码2为空");
}
if (form1.pwd1.value!=form1.pwd2.value) {
alert("密码1和密码2不相等");
}
}

</script>
<form id=form1 onsubmit="check()">
用户名<input id=user type=text><br>
密码<input id=pwd1 type=password><br>
密码确认<input id=pwd2 type=password><br>
<input type=submit value="注册" >&nbsp;&nbsp;&nbsp;<input type=reset value="重填">
</form>[/CODE]


吃的比猪还差,干的比驴还累,起的比鸡还早,睡得比小姐还晚,挣得比民工还少,看起来比谁都好——苦命的人.人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,该爱的时候就去爱,无谓压抑自己
2005-11-02 15:33
linuxpluto
Rank: 4
等 级:贵宾
威 望:13
帖 子:889
专家分:23
注 册:2005-8-14
收藏
得分:0 

<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
function Choice(strUrl){
parent.parent.mainFrame.location.href=strUrl;
//parent.Main.window.location.href=strUrl;
}
</script>
<script language="javascript">
function opinion()
{
if(form1.password1.value!=""&&form1.password1.value!=""&&form1.username.value!="")
{
if(form1.password1.value==form1.password2.value){
return true;
}else{
alter("两次密码输入不一致,请重新输入");
return false;
}
else{
alter("用户名和密码不能为空");
return false;
}

}
</script>
<body>
<div align="center">
<form name="form1" method="post" action="addsuc.jsp">
<table width="32%" border="1">
<tr>
<td><div align="center">用户注册</div></td>
</tr>
<tr>
<td>用户名:
&nbsp;&nbsp;&nbsp;&nbsp<input type="text" name="username">
</td>
</tr>
<tr>
<td>密 码:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp<input type="text" name="password1">
</td>
</tr>
<tr>
<td>密码确认:&nbsp;
<input type="text" name="password2">
</td>
</tr>
<tr>
<td>
<div align="center">
<input type="submit" name="Submit2" value="注册" onclick="return opinion()">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<input type="button" name="Submit" value="取消" onclick="users.jsp">
</div>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>
红字部分好好好看看~alert调用错误


吃的比猪还差,干的比驴还累,起的比鸡还早,睡得比小姐还晚,挣得比民工还少,看起来比谁都好——苦命的人.人生短短几十年,不要给自己留下了什么遗憾,想笑就笑,想哭就哭,该爱的时候就去爱,无谓压抑自己
2005-11-02 15:42
快速回复:斑竹 帮忙看看 急!!!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016796 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved