add a check function
所在版块:技术の宅 发贴时间:2004-02-10 16:12  评分:

用户信息
复制本帖HTML代码
高亮: 今天贴 X 昨天贴 X 前天贴 X 
<html>
<head>
<script language="javascript">
function check(){
if (document.form1.flag.value=="")
return false;
else
return true;
}
function func_submit(myform){
myform.flag.value="anyvalue"
if (check()){
myform.target="_self";
myform.action="detail.asp";
myform.submit();
}
}
</script>
</head>
<body>
<form name="form1" method="post" onsubmit="return check()">
<input name="name" type=text></input>
<input type="hidden" name="flag" value="">
</form>
<input type="button" name="btnsubmit" value="click me" onclick="func_submit(document.form1)">
</body>
</html>
.
欢迎来到华新中文网,踊跃发帖是支持我们的最好方法!

Put your OWN COOL signature here!
 相关帖子 我要回复↙ ↗回到正文
In asp, how can I restrict the "submit" button survivor   (147 bytes , 256reads )
try this 阿不错   (76 bytes , 154reads )
code like this 阿不错   (495 bytes , 180reads )
I tried urs, but pressing "enter" is still working.I wanna disable "enter key" survivor   (0 bytes , 157reads )
add a check function 阿不错   (576 bytes , 267reads )
it works for just one test field, if I have more than 2 text field , then survivor   (153 bytes , 161reads )
could be any text fields 阿不错   (35 bytes , 171reads )
I am using vb script, can u show me in that way,,,thx first survivor   (0 bytes , 166reads )
can explain wat's the use of "on press" and "on click" survivor   (0 bytes , 166reads )
it is doesn't work,,,anyohter suggestion? survivor   (0 bytes , 194reads )