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>
    

      

  • 相关阅读:
    openGL 纹理05
    音视频系列文章
    webrtc系列文章
    ! [rejected] master -> master (non-fast-forward)
    openGL 预定义变量04
    Android项目实战--手机卫士24--程序锁的实现以及逻辑
    大数记录之,大数乘整型数nyoj832
    与IO相关的等待事件troubleshooting-系列9
    发布文章时多少天、多少小时、多少分前发布功能
    CSS3之边框图片border-image
  • 原文地址:https://www.cnblogs.com/aljxy/p/3734286.html
Copyright © 2011-2022 走看看