如何实现点击一个按钮跳转到另一个页面,比如用submit该怎么用啊,或是其他的又该怎么用 <input type="button" name="Submit" value="按钮" onClick="window.location.href=new.htm"> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <form action="tourl.php" method="post">表单区...<input type="submit" value="提交">点击提交就自动转到tourl.php看看html教程就明白 <input type="submit" name="submit" onclick="check()">//check()函数是用来检查是否输入为空的我的原意是当用户点击submit按钮时,如果检查到输入某项为空时,便利用check()函数弹出提示,此刻就不能跳转到下一个页面了. 如果是向你们所说的这样设置<form action="下一页面地址" method="post">,这样一来的话,当用户名输入为空的时候,经检查后,弹出了提示后,仍然跳到下一页面,那不是毫无意义了吗?有什么其他的解决办法没? javascript 的onsubmit,自己写一个表单验证就是了 说详细点吧,你指的这个onsubmit是个控件还是javascript里内置的函数啊 <script language=javascript>fuction open(){ window.location.href="xx.htm";}</script><input type="submit" name="submit" onclick="open()">这就行了 用这种办法只要点了submit就会死板地毫无条件地跳到指定的页面啊. 如果是向你们所说的这样设置这样一来的话,当用户名输入为空的时候,经检查后,弹出了提示后,仍然跳到下一页面,那不是毫无意义了吗?有什么其他的解决办法没? <script language=javascript>fuction open(){ if(!document.form_name.username.value) { alert("请输入用户名!"); document.form_name.username.focus(); return false; }else document.form_name.action="xxx.htm";}</script><input type="submit" name="submit" onclick="open()">楼主,试试这个吧,应该没问题了,我没有测试 <html><head><title>管理员登录</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><script language=javascript>function CheckForm(){ if(document.Login.UserName.value=="") { alert("请输入用户名!"); document.Login.UserName.focus(); return false; } if(document.Login.Password.value == "") { alert("请输入密码!"); document.Login.Password.focus(); return false; } /* if (document.Login.CheckCode.value==""){ alert ("请输入您的验证码!"); document.Login.CheckCode.focus(); return(false); } */}</script></head><body><form name="Login" action="./login/login.php" method="post" target="_parent" onSubmit="return CheckForm();"><table width="300" border="0" align="center" cellpadding="5" cellspacing="0" class="border" > <tr class="title"> <td colspan="2" align="center"> <strong> 管理员登录 </strong></td> </tr> <tr> <td height="120" colspan="2" class="tdbg"><table width="250" border="0" cellspacing="8" cellpadding="0" align="center"> <tr> <td align="right">用户名称:</td> <td><input name="UserName" type="text" id="UserName2" size="23" maxlength="20" value=""></td> </tr> <tr> <td align="right">用户密码:</td> <td><input name="Password" type="password" size="23" maxlength="20" value=""></td> </tr> <!--<tr> <td align="right">验 证 码:</td> <td><input name="CheckCode" size="15" maxlength="6"> <img src="inc/checkcode.asp"></td> </tr>--> <tr> <td colspan="2"> <div align="center"> <input type="submit" name="Submit" value=" 确认 "> <input name="reset" type="reset" id="reset" value=" 清除 "> <br> </div></td> </tr> </table> </td> </tr> </table></form></body></html> apache重写问题 关于PHP网页怎样把英文的网页变成法语 php 本地测试 无法访问 很难很难的问题 重金悬赏!求SupeSite/X-Space模板开发 将页面导到EXCEL文件中 在PHP5.12 RC版用file_get_contents 说超时!~~~ vBulletin论坛的声望力和声望值探讨 【急!!!】如何查看网站是否有外网站的盗链? 为什么不能够正确的接收到chebox的值? 设置和访问Cookie的问题,请大家帮忙分析下 Call to undefined function: mysql_pconnect()
表单区...
<input type="submit" value="提交">
点击提交就自动转到tourl.php看看html教程就明白
我的原意是当用户点击submit按钮时,如果检查到输入某项为空时,便利用check()函数弹出提示,此刻就不能跳转到下一个页面了.
如果是向你们所说的这样设置<form action="下一页面地址" method="post">,这样一来的话,当用户名输入为空的时候,经检查后,弹出了提示后,仍然跳到下一页面,那不是毫无意义了吗?有什么其他的解决办法没?
fuction open()
{
window.location.href="xx.htm";
}
</script>
<input type="submit" name="submit" onclick="open()">
这就行了
如果是向你们所说的这样设置这样一来的话,当用户名输入为空的时候,经检查后,弹出了提示后,仍然跳到下一页面,那不是毫无意义了吗?有什么其他的解决办法没?
fuction open()
{
if(!document.form_name.username.value)
{
alert("请输入用户名!");
document.form_name.username.focus();
return false;
}else
document.form_name.action="xxx.htm";
}
</script>
<input type="submit" name="submit" onclick="open()">
楼主,试试这个吧,应该没问题了,我没有测试
<head>
<title>管理员登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language=javascript>
function CheckForm()
{
if(document.Login.UserName.value=="")
{
alert("请输入用户名!");
document.Login.UserName.focus();
return false;
}
if(document.Login.Password.value == "")
{
alert("请输入密码!");
document.Login.Password.focus();
return false;
}
/*
if (document.Login.CheckCode.value==""){
alert ("请输入您的验证码!");
document.Login.CheckCode.focus();
return(false);
}
*/
}
</script>
</head>
<body>
<form name="Login" action="./login/login.php" method="post" target="_parent" onSubmit="return CheckForm();">
<table width="300" border="0" align="center" cellpadding="5" cellspacing="0" class="border" >
<tr class="title">
<td colspan="2" align="center"> <strong> 管理员登录 </strong></td>
</tr> <tr>
<td height="120" colspan="2" class="tdbg">
<table width="250" border="0" cellspacing="8" cellpadding="0" align="center">
<tr>
<td align="right">用户名称:</td>
<td><input name="UserName" type="text" id="UserName2" size="23" maxlength="20" value=""></td>
</tr>
<tr>
<td align="right">用户密码:</td>
<td><input name="Password" type="password" size="23" maxlength="20" value=""></td>
</tr>
<!--<tr>
<td align="right">验 证 码:</td>
<td><input name="CheckCode" size="15" maxlength="6"> <img src="inc/checkcode.asp"></td>
</tr>-->
<tr>
<td colspan="2"> <div align="center">
<input type="submit" name="Submit" value=" 确认 ">
<input name="reset" type="reset" id="reset" value=" 清除 ">
<br>
</div></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>