zoukankan      html  css  js  c++  java
  • JSP | 基础 | 在同一表单中提交两个不同的action

    通过与跟JS配合使用实现需求

    <head>
        <title>Chat Room</title>
        <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
        <script type="text/javascript" src="js/chat.js"></script>
        <link rel="stylesheet" href="css/chat.css"/>
        <Script Language="JavaScript"> 
            function modify() 
            { 
                document.chatform.action="chat"; 
                document.chatform.submit(); 
            } 
             
            function exit() 
            {
                document.chatform.action="outlogin.jsp";
                document.chatform.submit();
            }
            
        </Script> 
    </head>
    
    <body>
      
            <form name="chatform" action="chat" method="post">
                <table cellpadding="0" cellspacing="0">
    <tr> <td class="pl"> <input id="Button1" type="button" value="Send" class="btn" onClick="modify()"/> <input id="Button2" type="button" value="Exit" class="btn" onClick="exit()"/> <input id="Button4" style="display:none" type="button" value="Hide" class="btn"/> </td> </tr> </table> </form> </body>

    扩展:

      提交form的时候,附带默认参数。

    需要在表单里添加一个隐藏的input

    <input type="hidden" name="args" value="888">

    学习博客:

    https://blog.csdn.net/LF_Software_Studio/article/details/7370007

  • 相关阅读:
    51 nod 1279 扔盘子
    洛谷 P2911 [USACO08OCT]牛骨头Bovine Bones
    1759 加减表达式
    1750 加法表达式
    poj 1006 Biorhythms
    vijos 1198 最佳课题选择
    poj 1390 Blocks
    codevs 3324 新斯诺克
    codevs 2075 yh女朋友的危机
    对拍器
  • 原文地址:https://www.cnblogs.com/jj81/p/9783294.html
Copyright © 2011-2022 走看看