一个关于输出消息框的问题,实现了码上给分 希望对你有帮助! (我只给出了html部分,你应该会修改成asp吧?) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不好意思,忘了贴代码:)<html><head><title>入库记录查询 </title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><link href="CssLib/TOOLBARS.CSS" rel="stylesheet" type="text/css"><script language="javascript"><!--function validate(){ var t=0 var c, d, e,f,g,h c=parseInt(document.form1.s_year.value) d=parseInt(document.form1.s_month.value) e=parseInt(document.form1.s_day.value) f=parseInt(document.form1.e_year.value) g=parseInt(document.form1.e_month.value) h=parseInt(document.form1.e_day.value)//*********************查询时,年月日要么都填,要么都不填,不能只填写其中一项进行查询.****************** if ((document.form1 .s_year .value =="" || document.form1 .s_month .value =="" || document.form1 .s_day .value =="" || document.form1 .e_year .value =="" || document.form1 .e_month .value =="" || document.form1 .e_day .value =="") && (document.form1 .s_year .value !="" || document.form1 .s_month .value !="" || document.form1.s_day .value !="" || document.form1 .e_year .value !="" || document.form1 .e_month .value !="" || document.form1 .e_day .value !="") && (t!=1)) { alert("年月日填写不完整!") t=1 }//********************************************************************************************************** if (document.form1.s_year.value!="" && document.form1 .s_month .value !="" && document.form1 .s_day .value !="" && document.form1.e_year.value!="" && document.form1 .e_month .value !="" && document.form1 .e_day .value !="" && t!=1) { if (t!=1 && (c>3000 || c<1000 )) { window.alert( "起始年超出范围") t=1 } if (t!=1 && (d>12 || d<1)) { window.alert( "起始月超出范围") t=1 } if (t!=1 && ( e>31 || e<1)) { window.alert( "起始日超出范围") t=1 } if (t!=1 && (f>3000 || f<1000 )) { window.alert( "结束年超出范围") t=1 } if (t!=1 && (g>12 || g<1)) { window.alert( "结束月超出范围") t=1 } if (t!=1 && ( h>31 || h<1)) { window.alert( "结束日超出范围") t=1 } } if (t!=1) { document.form1 .method ="post" document.form1.action="" document.form1.submit() }}//--></script></head><body bgcolor="#deebff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"><br><table width="80%" border="0" align="center" cellpadding="2" cellspacing="0"> <tr> <td> <div align="center"><strong>入库记录查询 </strong> </div> <div align="center"></div></td> </tr></table><form name="form1"> <div align="center"> <table width="51%" height="203" border="1" cellpadding="2" cellspacing="0"> <tr> <td><div align="center"> <select name="bh" > <option value="1">物资名称</option> <option value="2">规格型号</option> </select> </div></td> <td><div align="center"> <input type="text" name="textfield"> </div></td> </tr> <tr> <td><div align="center">入库人:</div></td> <td><div align="center"> <input type="text" name="psnname"> </div></td> </tr> <tr> <td><div align="center">入库日期:</div></td> <td><div align="center">从 <input name="s_year" type="text" size="4" maxlength="4"> 年 <input name="s_month" type="text" size="2" maxlength="2"> 月 <input name="s_day" type="text" size="2" maxlength="2"> 日 </div></td> <td><div align="center">到 <input name="e_year" type="text" size="4" maxlength="4"> 年 <input name="e_month" type="text" size="2" maxlength="2"> 月 <input name="e_day" type="text" size="2" maxlength="2"> 日 </div></td> </tr> </table> <br> <table width="148" height="42" border="0" cellpadding="2" cellspacing="0"> <tr> <td><div align="center"> <input type="button" name="button1" value="查询" onclick="validate()"> </div></td> <td><div align="center"> <input type="reset" name="cancel" value="取消"> </div></td> </tr> </table> </div></form><script language="JavaScript"><!--if (document.layers)document.captureEvents(event.KeyPress);function blockA(e) {if (document.layers) var keyChar =e.which;if (document.all) var keyChar =event.keyCode;if (keyChar>57 || keyChar<48){alert('请输入数字!');return false;}}document.form1.s_year.onkeypress = blockA;document.form1.s_month.onkeypress = blockA;document.form1.s_day.onkeypress = blockA;document.form1.e_year.onkeypress = blockA;document.form1.e_month.onkeypress = blockA;document.form1.e_day.onkeypress = blockA;//--></script></body></html> 求一个限制输入数字的正则表达式 看下大家JavaScript开发用神马工具开发的 Web问题 关于charAt(i)的问题 提交参数到父页面并更新 关于DEFANGED_Onload用法 求一个对图片后缀判断的正则表达式?急用。。。 谁能帮我找到这个网页中播放文件的Url。 怎么可以在修改资料时输入错误信息返回到上一步啊 地图截图功能 聊天室中如何实现 CTRL+ENTER 发送信息? 如何在网站上屏蔽ie的输入记忆功能
<html>
<head>
<title>入库记录查询 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="CssLib/TOOLBARS.CSS" rel="stylesheet" type="text/css">
<script language="javascript">
<!--
function validate()
{
var t=0
var c, d, e,f,g,h c=parseInt(document.form1.s_year.value)
d=parseInt(document.form1.s_month.value)
e=parseInt(document.form1.s_day.value)
f=parseInt(document.form1.e_year.value)
g=parseInt(document.form1.e_month.value)
h=parseInt(document.form1.e_day.value)//*********************查询时,年月日要么都填,要么都不填,不能只填写其中一项进行查询.****************** if ((document.form1 .s_year .value =="" || document.form1 .s_month .value =="" || document.form1 .s_day .value =="" || document.form1 .e_year .value =="" || document.form1 .e_month .value =="" || document.form1 .e_day .value =="") && (document.form1 .s_year .value !="" || document.form1 .s_month .value !="" || document.form1.s_day .value !="" || document.form1 .e_year .value !="" || document.form1 .e_month .value !="" || document.form1 .e_day .value !="") && (t!=1))
{
alert("年月日填写不完整!")
t=1
}//********************************************************************************************************** if (document.form1.s_year.value!="" && document.form1 .s_month .value !="" && document.form1 .s_day .value !="" && document.form1.e_year.value!="" && document.form1 .e_month .value !="" && document.form1 .e_day .value !="" && t!=1)
{
if (t!=1 && (c>3000 || c<1000 ))
{
window.alert( "起始年超出范围")
t=1 }
if (t!=1 && (d>12 || d<1))
{
window.alert( "起始月超出范围")
t=1 }
if (t!=1 && ( e>31 || e<1))
{
window.alert( "起始日超出范围")
t=1 }
if (t!=1 && (f>3000 || f<1000 ))
{
window.alert( "结束年超出范围")
t=1 }
if (t!=1 && (g>12 || g<1))
{
window.alert( "结束月超出范围")
t=1 }
if (t!=1 && ( h>31 || h<1))
{
window.alert( "结束日超出范围")
t=1 }
}
if (t!=1)
{
document.form1 .method ="post"
document.form1.action=""
document.form1.submit()
}
}
//-->
</script>
</head><body bgcolor="#deebff" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<br>
<table width="80%" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td> <div align="center"><strong>入库记录查询 </strong> </div>
<div align="center"></div></td>
</tr>
</table>
<form name="form1">
<div align="center">
<table width="51%" height="203" border="1" cellpadding="2" cellspacing="0">
<tr>
<td><div align="center">
<select name="bh" >
<option value="1">物资名称</option>
<option value="2">规格型号</option>
</select>
</div></td>
<td><div align="center">
<input type="text" name="textfield">
</div></td>
</tr>
<tr>
<td><div align="center">入库人:</div></td>
<td><div align="center">
<input type="text" name="psnname">
</div></td>
</tr>
<tr>
<td><div align="center">入库日期:</div></td>
<td><div align="center">从
<input name="s_year" type="text" size="4" maxlength="4">
年
<input name="s_month" type="text" size="2" maxlength="2">
月
<input name="s_day" type="text" size="2" maxlength="2">
日 </div></td>
<td><div align="center">到
<input name="e_year" type="text" size="4" maxlength="4">
年
<input name="e_month" type="text" size="2" maxlength="2">
月
<input name="e_day" type="text" size="2" maxlength="2">
日 </div></td>
</tr>
</table>
<br>
<table width="148" height="42" border="0" cellpadding="2" cellspacing="0">
<tr>
<td><div align="center">
<input type="button" name="button1" value="查询" onclick="validate()">
</div></td>
<td><div align="center">
<input type="reset" name="cancel" value="取消">
</div></td>
</tr>
</table>
</div>
</form><script language="JavaScript">
<!--
if (document.layers)
document.captureEvents(event.KeyPress);
function blockA(e) {
if (document.layers)
var keyChar =e.which;
if (document.all)
var keyChar =event.keyCode;
if (keyChar>57 || keyChar<48)
{
alert('请输入数字!');
return false;
}
}
document.form1.s_year.onkeypress = blockA;
document.form1.s_month.onkeypress = blockA;
document.form1.s_day.onkeypress = blockA;
document.form1.e_year.onkeypress = blockA;
document.form1.e_month.onkeypress = blockA;
document.form1.e_day.onkeypress = blockA;
//-->
</script></body>
</html>