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

  • 相关阅读:
    回调函数
    未能正确加载“Microsoft.VisualStudio.Editor.Implementation.EditorPackage”包
    顶帽变化(转载)
    协程 + asyncio
    docker
    vue+uwsgi+nginx部署前后端分离项目
    html
    关于html的基础标签
    关于python中的GIL
    hashlib模块
  • 原文地址:https://www.cnblogs.com/jj81/p/9783294.html
Copyright © 2011-2022 走看看