zoukankan      html  css  js  c++  java
  • 怎样在form里判断执行2个action

    <form   method='post'   name="form1">   
      用户名:
    <input   type='input'   name='username'   value=""   class='input'   >   
      密   码:
    <input   type='password'   name='password'   class='input'>   
      
    <input   type="button"   value="登录1"   name="登录1"   class="logbt"   onclick="submitEvent(1)">   
      
    <input   type="button"   value="登录2"   name="登录2"   class="logbt"   onclick="submitEvent(2)">   
      
    </form>   
      
    <script   language="javascript">   
      
    function   submitEvent(type){   
      
    if(type==1)   
      
    {   
              form1.action
    ="action1url";   
              form1.submit();   
      }
       
      
    if(type==2){   
              form1.action
    ="action1ur2";   
              form1.submit();   
      }
       
      }
       
      
    </script>  

    <form   method='post'   name="form1">   
      用户名:
    <input   type='input'   name='username'   value=""   class='input'   >   
      密   码:
    <input   type='password'   name='password'   class='input'>   
      
    <input   type="button"   value="登录1"   name="confirm"   class="logbt"   >   
      
    <input   type="button"   value="登录2"   name="confirm"   class="logbt"   >   
      
    </form>   
      
    <script   language="javascript"   for="confirm"   event="onclick">   
      
    if(event.srcElement.value=="登录1")   
      
    {   
              
    //alert(event.srcElement.value)   
      form1.action="action1url";   
      form1.submit();   
      }
       else   {   
      form1.action
    ="action1ur2";   
      form1.submit();   
      }
       
      
    </script>
  • 相关阅读:
    字节流、字符流
    ArrayList、LinkedList、Vector 的区别。
    Java 为每个原始类型提供了哪些包装类型:
    int 和 Integer 有什么区别
    怎样自动把报表插入到 word 文档中
    web 报表中电子图章 / 水印的轻松实现
    玩转报表排名
    报表设计技巧之隔行异色
    单据类报表的制作
    轻松 get 报表模糊查询技能
  • 原文地址:https://www.cnblogs.com/starm/p/906811.html
Copyright © 2011-2022 走看看