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>
  • 相关阅读:
    js循环小练习
    计算字符串字节数
    查找最小值
    js文本复制插件&vue
    python打包成exe(py2exe)
    window2008 64位系统没有office组件问题分析及解决
    js onchange事件
    input file里的JQ change() 事件的只生效一次
    powerdesign的license key到期,解决办法
    JQuery好用的日期选择控件 DatePicker
  • 原文地址:https://www.cnblogs.com/starm/p/906811.html
Copyright © 2011-2022 走看看