我对"表单为空"进行了验证,提交时也弹出了"标题不能为空!"的弹窗,但是点击"确定"后,代码还是执行了,怎么回事?
代码如下:<script language="JavaScript">
function checkform(myform){
if(myform.texttilte.value==""){
alert("标题不能为空!");
return false;
}
return true;
}
</script>
......
<FORM method="POST" name="myform" action="submit.jsp" onsubmit="return checkform(this)">
代码如下:<script language="JavaScript">
function checkform(myform){
if(myform.texttilte.value==""){
alert("标题不能为空!");
return false;
}
return true;
}
</script>
......
<FORM method="POST" name="myform" action="submit.jsp" onsubmit="return checkform(this)">
function checkform(myform){
if(myform.texttilte.value==""){
alert("标题不能为空!");
return false;
}
return true;
}
</script>
......
<FORM method="POST" name="myform" action="submit.jsp" onsubmit="return checkform(this)">
<input type="text" name="texttilte">
<input type="submit">
</form>代码是对的撒
麻烦再看一下
<FORM method="POST" name="myform" action="submit.jsp" onsubmit="return checkform(this)">
<TABLE border="0" cellpadding="2" cellspacing="1"><TR>
<TD>标题:</TD>
<TD><input type="text" name="texttilte" size="60"></TD>
</TR><TR>
<TD>内容:</TD>
<TD>
<INPUT type="hidden" name="content1" value="aaaa">
<IFRAME ID="a" src="a.jsp?id=content1&style=standard" frameborder="0" scrolling="no" width="650" height="350"></IFRAME>
</TD>
</TR>
<TR>
<TD colspan=2 align=right>
<INPUT type=submit name=b1 value="提交">
<INPUT type=reset name=b2 value="重填">
</TD>
</TR></TABLE>
</FORM>
别人就解决了,看来人品有问题的是你了,呵呵....
建议改装一下。
<script language="JavaScript">
function checkform(myform){
if(myform.texttilte.value==""){
alert("标题不能为空!");
return false;
}
return true;
}
</script>
......
<FORM method="POST" name="myform" action="submit.jsp">
……
<INPUT NAME = "texttilte">
<INPUT TYPE = "BUTTON" NAME = "提交" ONCLICK = "checkform()">
</FORM>
================
你丫丢人去吧,
前边看你四不像,后边看你四个都像,撒泡尿照照你的长相,低级动物跟你都很像.
人品跟你没关系,因为你丫只有猪品!
========================
看来你的人品、长相、品种、都有问题
dzyx1266()
dzyx1263()
一看他吗就是个煞笔,每次来申请一个帐号
<script language="JavaScript">
function checkform(myform){
if(myform.texttilte.value==""){
alert("标题不能为空!");
return false;
}
}
</script>
还有就是标点 符号的问题了 你看你的标点符号对不对?
function checkform(myform){
if(myform.texttilte.value==""){
alert("标题不能为空!");
return false;
}
return true;
}
</script>
......
<FORM method="POST" name="myform" action="submit.jsp" onsubmit="return checkform(this)">
<input type="text" name="texttilte">
<input type="submit">
</form>
我上次也遇到过这样的问题的!我记不清楚了!好象是去掉return false;还是return true;我记得不清楚了!你要不要试一下!
跟你这中垃圾没什么好说的!滚吧..