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

  • 相关阅读:
    python刷新七牛云CDN缓存
    python 操作redis
    redis 设置密码
    redis 允许其他机器连接设置方法
    redis持久化
    redis操作
    redis简介及与memcached比较
    dataframe 处理某列的小数位数并加特殊符号
    django 生成和下载CSV文件
    django 重定向
  • 原文地址:https://www.cnblogs.com/jj81/p/9783294.html
Copyright © 2011-2022 走看看