<script language="javascript">
function checkNum(str){
if(!/\D/.test(str))
eval(form+".submit()");
else
alert("请输入数字!");
}
</script>
function checkNum(str){
if(!/\D/.test(str))
eval(form+".submit()");
else
alert("请输入数字!");
}
</script>
解决方案 »
- jquery ajax 读取xml,如何修改里面的值,求大神解决。在线等啊
- 用jquery实现ie6对div:hover属性的支持,遇到了问题,大家帮忙解决下
- 用JS批量删除问题!
- 急!急!急!JavaScript判断listbox问题!
- 这段代码错在哪了?困惑
- 为什么我的div位置会随着窗口的大小而变化,怎么解决?
- 一个文本框中提交后如何判断它的内容是否是以“000”开头,是用正则匹配吗?请各位大虾指点,解决问题马上给分
- 如何在框架中以合适的大小显示我的其他网页
- 我用程序控制左边的frame的边界向左移,我想frame的网页的左边界跟frame一齐移动,怎么做?
- JSP中中文字符的显示
- 如何解决:总是处于响应未结束的现象
- 如何实现一进入页面,就让滚动条到最底部,急!!!
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function checkNum(str){
if(!/\D/.test(str))
eval(form+".submit()");
else
alert("请输入数字!");
}
</script></head><body bgcolor="#FFFFFF" text="#000000">
<form name=form1 method=post action="post.asp">
<input name= text1 type=text>
<input type=button value=button1 name=button1 onclick="javascript:checkNum(form1.text1.value)">
</form><form name=form2 method=post action="post.asp">
<input name= text2 type=text >
<input type=button value=submit onclick="javascript:checkNum(form2.text2.value)">
</form></body>
</html>
function checkNum(str,form){
if(!/\D/.test(str))
form.submit();
else
alert("请输入数字!");
}
</script></head><body bgcolor="#FFFFFF" text="#000000">
<form name=form1 method=post action="post.asp">
<input name= text1 type=text>
<input type=button value=button1 name=button1 onclick="javascript:checkNum(this.form.text1.value,this.form)">
</form><form name=form2 method=post action="post.asp">
<input name= text2 type=text >
<input type=button value=submit onclick="javascript:checkNum(this.form.text2.value.this.form)">
</form>
请问那位高手可以解决啊!!!
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
<form action="" method="get" name="form1">
<input name="noname" type="text" onBlur="checkNum(this.value,'form1')">
</form>
</body>
</html>
<script language="javascript">
function checkNum(str,formname)
{
if(!/\D/.test(str)){
(eval(formname)).submit();
}
else{
alert("请输入数字!");
}
}
</script>
function checkNum(str,form){
if(!/\D/.test(str))
form.submit();
else
alert("请输入数字!");
}
</script><form name=ex method=post action="">
<input name=text1 type=text size="20">
<input type=button value=button1 name=button1 onclick="checkNum(this.form.text1.value,this.form)">
</form><form name=qq method=post action="">
<input name=text2 type=text size="20" >
<input type=button value=button2 name=button2 onclick="checkNum(this.form.text2.value,this.form)">
</form>
....
<input type=button value=submit onclick="javascript:checkNum(this.form.text2.value,this.form)">
</form>
是,不是.