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>
    

      

  • 相关阅读:
    ActiveMQ的spring配置文件
    ActiveMQ consumer按顺序处理消息
    ActiveMQ异步分发消息
    2个线程顺序工作
    hadoop更换硬盘
    linux内存条排查
    gitlab迁移升级
    linux 监控网卡实时流量iftop
    gitlab7.2安装
    为首次部署MongoDB做好准备:容量计划和监控
  • 原文地址:https://www.cnblogs.com/aljxy/p/3734286.html
Copyright © 2011-2022 走看看