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>
  • 相关阅读:
    modal
    NSSpeechSynthesizer 文字变语音
    AVFoundation 初识
    语系/地区码
    Mac 平台下安装 OpenVC
    19-iOS图形性能
    01-产品发布10个大坑
    18-NSString之Strong和copy
    17-xcode6插件开发入门
    16-不能错过的Xcode插件
  • 原文地址:https://www.cnblogs.com/starm/p/906811.html
Copyright © 2011-2022 走看看