zoukankan      html  css  js  c++  java
  • 一个表单两个提交按钮的实现

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>一个form两个提交按钮,分别提交到两页面</title>
    <script type="text/javascript">  
        function save()
         {   
             document.form1.action="a.asp";
             document.form1.submit();
         }
        
        function send()
         {
             document.form1.action="b.asp";
             document.form1.submit();
         }   
    </script>
    </head>
    <body>
    <form name="form1" method="post"> <!--method 必须写-->
      <input type="text" name="username" value="scott">
      <input type="button" value="发送" onclick="send();">
      <input type="button" value="保存" onclick="save();">
    </form>
    </body>
    </html>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>一个form两个提交按钮,分别提交到两页面</title>
    <script type="text/javascript">  
        function send()
         {
            if (i==1)
             {document.form1.action="b.asp";}
            else
             {document.form1.action="a.asp";}
             document.form1.submit();
         }   
    </script>
    </head>
    <body>
    <form name="form1">
      <input type="text" name="username" value="scott">
      <input type="button" value="发送" onclick="send(0);">
      <input type="button" value="保存" onclick="send(1);">
    </form>
    </body>
    </html>
    

      

  • 相关阅读:
    sql 临时表循环更新月租金
    董事长审核租金异常处理备份
    datetable导出成Excel
    DateTable导出添加时间段
    button 美化
    JS计算两日期之间相差的月份
    刚做的JS,备份一下(空代表格计算)
    Windows 框架基础开发流程
    照片切换
    Sql datetime类型数据默认1900
  • 原文地址:https://www.cnblogs.com/aljxy/p/3734286.html
Copyright © 2011-2022 走看看