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>
    

      

  • 相关阅读:
    HTML5-MathML-基础篇
    HTML5-SVG-基础篇
    HTML5-canvas-基础篇
    HTML基础
    套接字缓存之skb_clone、pskb_copy、skb_copy
    套接字缓存之alloc_skb、dev_alloc_skb、kfree_skb、dev_kfree_skb、consume_skb
    套接字缓存之skb_put、skb_push、skb_pull、skb_reserve
    套接字缓存之sk_buff结构
    网络设备之监测连接状态
    网络设备之关闭
  • 原文地址:https://www.cnblogs.com/aljxy/p/3734286.html
Copyright © 2011-2022 走看看