<input type="button" name="Submit" value="按钮" onClick="window.location.href=new.htm">

解决方案 »

  1.   

    <form action="tourl.php" method="post">
    表单区...
    <input type="submit" value="提交">
    点击提交就自动转到tourl.php看看html教程就明白
      

  2.   

    <input type="submit" name="submit" onclick="check()">//check()函数是用来检查是否输入为空的
    我的原意是当用户点击submit按钮时,如果检查到输入某项为空时,便利用check()函数弹出提示,此刻就不能跳转到下一个页面了.
      如果是向你们所说的这样设置<form action="下一页面地址" method="post">,这样一来的话,当用户名输入为空的时候,经检查后,弹出了提示后,仍然跳到下一页面,那不是毫无意义了吗?有什么其他的解决办法没?
      

  3.   

    javascript 的onsubmit,自己写一个表单验证就是了
      

  4.   

    说详细点吧,你指的这个onsubmit是个控件还是javascript里内置的函数啊
      

  5.   

    <script language=javascript>
    fuction open()
    {
     window.location.href="xx.htm";
    }
    </script>
    <input type="submit" name="submit" onclick="open()">
    这就行了
      

  6.   

    用这种办法只要点了submit就会死板地毫无条件地跳到指定的页面啊.
      如果是向你们所说的这样设置这样一来的话,当用户名输入为空的时候,经检查后,弹出了提示后,仍然跳到下一页面,那不是毫无意义了吗?有什么其他的解决办法没?
      

  7.   

    <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()">
    楼主,试试这个吧,应该没问题了,我没有测试
      

  8.   

    <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=" 确认 ">
                    &nbsp;
                    <input name="reset" type="reset"  id="reset" value=" 清除 ">
                    <br>
                  </div></td>
              </tr>
            </table>
            </td>
          </tr>
        </table>
    </form>
    </body>
    </html>