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>
  • 相关阅读:
    Python设置桌面壁纸
    youtube-dl使用介绍
    Matlab pcg函数的句柄形式之参数传递
    Sublime 安装支持GBK的插件
    MarkdownPad安装
    ug7.5经常卡死的解决方法
    HM NIS edit打包软件
    UG工程制图
    egg框架中是如何使用MD5加密的 实现用户修改密码 小编在这里献丑了。。。。。
    今天遇到了vue项目中使用Iconfont图标 ,感觉挺实用的 随手记录下。只需简单的6步就可以实现
  • 原文地址:https://www.cnblogs.com/starm/p/906811.html
Copyright © 2011-2022 走看看