中止当前页面执行
我要判断一个文本框 当为空时 提示 ,不发送页面 怎么做的?
谢谢;
我的思路如下 但是不对
<head>
function testAlert(str)
{
if(str.length==0)
{
alert( 'len 0 ');
return ;
}
</head>
<body>
邮箱 <input id= "email " name= "email " type= "text ">
<p> <input type= "submit " value= "alert in client " onclick= "return testAlert( document.Form1.email.value) "runat= "server " id= "Submit2 " name= "Submit2 "> </p>
</body>
------解决方案-------------------- <script language= "javascript ">
function checkForm() {
if (...) {
return false;
}
}
</script>
<form onsubmit= "return checkForm(); "> </form>
------解决方案--------------------少了form 标点的标记了 把
<form id= "Form1 " name= "Form1 ">
</form>