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>
  • 相关阅读:
    opencv访问图像像素
    利用chrome浏览器的proxy switchy扩展智能切换代理
    一些linux命令【ubuntu】
    如何从 Ubuntu 10.04 升级到 10.10
    关于“无法获得排它锁 ”的解决办法
    【ubuntu】Grub2配置详解(转)
    BibTeX使用介绍
    【ubuntu】imagemagick用法
    ubuntu环境下安装OpenCV
    安装wordpress
  • 原文地址:https://www.cnblogs.com/starm/p/906811.html
Copyright © 2011-2022 走看看