| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1098 人关注过本帖
标题:当点击提交的时候,javascript函数不运行
取消只看楼主 加入收藏
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
结帖率:98.25%
收藏
 问题点数:0 回复次数:2 
当点击提交的时候,javascript函数不运行

<html>
<HEAD>
<title>New Page 1</title>
<%'会议预定页面%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">

</HEAD>
<body>
<%
hidSql = Request.Form("Hid_Sql")
if hidSql = "1" then
dsn = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("meeting.mdb")
set conn = Server.CreateObject("ADODB.Connection")
conn.Open dsn

sqlSelect = "select * from meeting"
set rsMeeting = server.createobject("ADODB.Recordset")
rsMeeting.Open sqlSelect, conn, 1, 3

rsMeeting.AddNew

rsMeeting("companyName") = Request.Form("companyName")
rsMeeting("address") = Request.Form("address")
rsMeeting("postalcode") = Request.Form("postalcode")
rsMeeting("fax") = Request.Form("fax")
rsMeeting("realName1") = Request.Form("realName1")
rsMeeting("sex1") = Request.Form("sex1")
rsMeeting("duty1") = Request.Form("duty1")
rsMeeting("tel1") = Request.Form("tel1")
rsMeeting("moveTel1") = Request.Form("moveTel1")
rsMeeting("arriveTime1") = Request.Form("arriveTime1")
rsMeeting("realName2") = Request.Form("realName2")
rsMeeting("sex2") = Request.Form("sex2")
rsMeeting("duty2") = Request.Form("duty2")
rsMeeting("tel2") = Request.Form("tel2")
rsMeeting("moveTel2") = Request.Form("moveTel2")
rsMeeting("arriveTime2") = Request.Form("arriveTime2")
rsMeeting("realName3") = Request.Form("realName3")
rsMeeting("sex3") = Request.Form("sex3")
rsMeeting("duty3") = Request.Form("duty3")
rsMeeting("tel3") = Request.Form("tel3")
rsMeeting("moveTel3") = Request.Form("moveTel3")
rsMeeting("arriveTime3") = Request.Form("arriveTime3")
rsMeeting("payment") = Request.Form("payment")

rsMeeting.Update

rsMeeting.Close
conn.Close
%>
<script language="Javascript">
window.open("ad.htm","","height=220,width=280,top=0,left=0,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=NO,location=no");
</script>
<%

else
%>

<p></p>
<script language="javascript">
function FunIsNull()
{
window.alert("asdf");
if(document.form1.companyName.value == "" || document.form1.address.value == "" || document.form1.postalcode.value =="" || document.form1.fax.value =="")
{
alert("请输入公司的基本信息");
return false;
}
if((document.form1.realName1.value <> "" || document.form1.duty1.value <> "" || document.form1.tel1.value <> "") &&
(document.form1.realName1.value == "" || document.form1.duty1.value == "" || document.form1.tel1.value == ""))
{
alert("请将个人信息填写完全");
return false;
}
if((document.form1.realName2.value <> "" || document.form1.duty2.value <> "" || document.form1.tel2.value <> "") &&
(document.form1.realName2.value == "" || document.form1.duty2.value == "" || document.form1.tel2.value == ""))
{
alert("请将个人信息填写完全");
return false;
}
if((document.form1.realName3.value <> "" || document.form1.duty3.value <> "" || document.form1.tel3.value <> "") &&
(document.form1.realName3.value == "" || document.form1.duty3.value == "" || document.form1.tel3.value == ""))
{
alert("请将个人信息填写完全");
return false;
}
if(document.form1.realName1.value == "" && document.form1.realName2.value == "" && document.form1.realName3.value == "")
{
alert("请输入个人信息");
return false;
}
}
</script>
<form name="form1" method="post" action="Preconcert.asp" onsubmit="return FunIsNull();">
<P align="left"><font face="幼圆"><b>
<TABLE id="Table1" height="96" cellSpacing="0" cellPadding="0" width="536" border="1">
<TR>
<TD bgColor="silver" colSpan="2">
<P align="left"><FONT face="宋体"></FONT><STRONG>公司基本信息</STRONG></P>
</TD>
</TR>
<TR>
<TD><STRONG>单位名称:</STRONG></TD>
<TD><input type="text" name="companyName" size="54"><FONT color="#cc0033">*</FONT></TD>
</TR>
<TR>
<TD><STRONG>通讯地址:</STRONG></TD>
<TD><INPUT type="text" size="54" name="address"><STRONG></STRONG><FONT color="#cc0033">*</FONT></TD>
</TR>
<TR>
<TD><STRONG>邮政编码:</STRONG></TD>
<TD><INPUT type="text" size="18" name="postalcode"><STRONG></STRONG><FONT color="#cc0033">*</FONT>&nbsp;</TD>
</TR>
<TR>
<TD><STRONG>公司传真:</STRONG></TD>
<TD><INPUT type="text" size="18" name="fax"><STRONG></STRONG><FONT color="#cc0033">*</FONT></TD>
</TR>
</TABLE>
</b></font><font face="幼圆"><FONT color="#cc0033"></FONT></font>
</P>
<p align="center">
</p>
<FONT face="幼圆" color="#cc0033"></FONT>
<table border="1" width="100%" cellpadding="0" cellspacing="0">
<TR>
<TD align="center" width="16%" bgColor="#c6c3c6" colSpan="6">
<P align="left"><STRONG><FONT face="幼圆">人员基本信息</FONT></STRONG></P>
</TD>
</TR>
<tr>
<td width="16%" align="center" bgcolor="#c6c3c6"><b><font face="幼圆">姓名</font></b><FONT color="#cc0033">*</FONT></td>
<td width="16%" align="center" bgcolor="#c6c3c6"><b><font face="幼圆">性别</font></b><FONT color="#cc0033">*</FONT></td>
<td width="17%" align="center" bgcolor="#c6c3c6"><b><font face="幼圆">职务</font></b><FONT color="#cc0033">*</FONT></td>
<td width="17%" align="center" bgcolor="#c6c3c6"><b><font face="幼圆">电话</font></b><FONT color="#cc0033">*</FONT></td>
<td width="17%" align="center" bgcolor="#c6c3c6"><b><font face="幼圆">手机</font></b></td>
<td width="17%" align="center" bgcolor="#c6c3c6"><b><font face="幼圆">到达时间</font></b></td>
</tr>
<tr>
<td width="16%" align="center"><font face="幼圆"><input type="text" name="realName1" size="17"></font></td>
<td width="16%" align="center"><font face="幼圆"><input type="radio" value="男" name="sex1" checked>男&nbsp;
<input type="radio" name="sex1" value="女">女</font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="duty1" size="17"></font></td>
<td width="158" align="center"><font face="幼圆"><input type="text" name="tel1" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="moveTel1" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="arriveTime1" size="17"></font></td>
</tr>
<tr>
<td width="16%" align="center"><font face="幼圆"><input type="text" name="realName2" size="17"></font></td>
<td width="16%" align="center"><font face="幼圆"><input type="radio" value="男" name="sex2" checked>男&nbsp;
<input type="radio" name="sex2" value="女">女</font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="duty2" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="tel2" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="moveTel2" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="arriveTime2" size="17"></font></td>
</tr>
<tr>
<td width="16%" align="center"><font face="幼圆"><input type="text" name="realName3" size="17"></font></td>
<td width="16%" align="center"><font face="幼圆"><input type="radio" value="男" checked name="sex3">男&nbsp;
<input type="radio" name="sex3" value="女">女</font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="duty3" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="tel3" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="moveTel3" size="17"></font></td>
<td width="17%" align="center"><font face="幼圆"><input type="text" name="arriveTime3" size="17"></font></td>
</tr>
</table>
<p align="center">
<INPUT type="hidden" name="Hid_Sql" runat="server" value="1" id="Hidden1">
</p>
<p align="center"><font face="幼圆"><FONT color="#cc0033">*</FONT><b>会晤费的支付方式: <input type="radio" name="payment" value="银行电汇"></b>银行电汇<b>&nbsp;&nbsp;
<input type="radio" name="payment" value="邮局汇款"></b>邮局汇款<b>&nbsp;&nbsp; <input type="radio" name="payment" value="现金" checked></b>现金</font></p>
<p align="center">
</p>
<p align="center">
<input type="submit" value="提交" size="20">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="重写" name="B2"></p>
</form>
<%
end if
%>
</body>
</html>

当点击提交的时候,funIsNull函数不运行,各位帮我看看,谢谢了先。

搜索更多相关主题的帖子: javascript 函数 运行 
2006-02-09 09:25
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
可以了,谢谢。
还想问下,是不是在javascript中有语法错误,整个的<script language="javascript">就不运行了?
<SCRIPT language=javascript>

</script>

</script>[/code]

[此贴子已经被作者于2006-2-9 10:09:28编辑过]


本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2006-02-09 10:09
冰镇柠檬汁儿
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:北京
等 级:版主
威 望:120
帖 子:8078
专家分:6657
注 册:2005-11-7
收藏
得分:0 
哦,原来如此,谢谢

本来无一物,何处惹尘埃
It is empty at all here, Why pm 2.5 is so TMD high!
2006-02-09 10:35
快速回复:当点击提交的时候,javascript函数不运行
数据加载中...
 
   



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

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