精华内容
下载资源
问答
  • 关于Form表单中action参数传值的问题
    千次阅读
    2020-05-03 23:11:26

    form中get方法时action属性后面传递参数获取不到原因:

    浏览器会将表单数据封装为字符串,如controller=message&method=search,然后直接附在表单的 action URL 之后。这两者之间用问号(?)进行分隔度。如果GET请求知的表单action属性中已道经包含参数,浏览器会直接将其过滤掉,再附加form表单数据。

    因此,GET请求方式的表单的action属性中不能附带任何参数,如果需要附加额外的参数,可以采用内如下方式:

    1、采用POST请求方式,在容form中增加属性method="post"即可。

    2、如果仍然想使用GET请求方式,可以在form表单中添加相应的隐藏文本域,

    更多相关内容
  • 代码如下,核心代码为555和556...%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> <%-- Created by IntelliJ IDEA. User: zyf Date: 2019/4/11 Time: 11:48 To change this ...

    代码如下,核心代码为555和556两行

    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    <%--
      Created by IntelliJ IDEA.
      User: zyf
      Date: 2019/4/11
      Time: 11:48
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page language="java" import="fe.SysException" pageEncoding="UTF-8" %>
    <%@ page import="fe.report.ReportCreateServer" %>
    <%@ page import="fe.report.ReportManagerServer" %>
    <%@ page import="fe.res.ResourceManage" %>
    <%@ page import="fe.search.SearchComponent" %>
    <%@ page import="fe.sys.UserVO" %>
    <%@ page import="fe.taglib39.Tag" %>
    <%@ page import="fe.util.StringUtils" %>
    <%@ page import="java.util.LinkedHashMap" %>
    <%@ page import="java.util.Map" %>
    <%@ page import="fe.util.LogUtils" %>
    <%@ page import="fe.service.UserSession" %>
    <%@ page import="fe.dao.DataTable" %>
    <%@ page import="fe.datapool.DataPool" %>
    <%@ page import="client.clientimport.ClientReportCreatServer" %>
    <%@ page import="client.clientimport.ClientReportManagerServer" %>
    <%@ page import="java.util.ArrayList" %>
    <%@ page import="client.clientimport.ClientTag" %>
    <%
        String path = request.getContextPath(); //路径
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/"; //http路径
        ClientReportManagerServer server = (ClientReportManagerServer) ResourceManage.getContext("clientReportManagerServer");
        //ReportManagerServer server = (ReportManagerServer) ResourceManage.getContext("reportManager");
        ReportCreateServer createServer = (ReportCreateServer) ResourceManage.getContext("reportCreate");
        ClientReportCreatServer clientReportCreatServer = (ClientReportCreatServer)ResourceManage.getContext("clientReportCreatServer");
    
        String selectNames = request.getParameter("selectNames") == null ? "" : request.getParameter("selectNames");
        String selectFields = request.getParameter("selectFields") == null ? "" :  request.getParameter("selectFields");
        //已选字段数组
        String[] selectNameArray = selectNames.split(",");
        String[] selectFieldArray = selectFields.split(",");
    
    
        String reportId = request.getParameter("reportId"); //报表ID
        if ((StringUtils.isNull(reportId)) && request.getAttribute("reportId") != null)
            reportId = request.getAttribute("reportId").toString();
        String cpage = request.getParameter("cpage"); //报表页码
        if (StringUtils.isNull(cpage) && request.getAttribute("cpage") != null)
            cpage = request.getAttribute("cpage").toString();
    
        String html = ""; //
        String filter = null; //过滤条件
        if (request.getAttribute("filter") != null) {
            filter = request.getAttribute("filter").toString();
            filter = server.getPreviewReportFilter((UserVO) session.getAttribute("User"), filter);
        }
        String css = server.getReportCss(reportId); //报表样式
        int total[] = new int[2]; //总行数及总页数
        try {
            total = server.getReportDataTotalPages(reportId, filter, (UserVO) session.getAttribute("User"));
        } catch (SysException e) {
            request.setAttribute("error", e.getMessage());
            throw e;
        } catch (Exception e) {
            LogUtils.error(e);
            request.setAttribute("error", "报表数据查询出错,请联系管理员");
            throw new SysException("报表数据查询出错,请联系管理员");
        }
    
        cpage = total[1] > 0 ? (cpage == null || "0".equals(cpage) ? "1" : cpage) : "1";
    
        int chartNumber = server.reportChartNumber(reportId); //图形报表数
    
        SearchComponent searchComponent = new SearchComponent();
    
        String newCell = request.getParameter("newCell"); //新增的查询条件
    
    
    %>
    
    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>报表呈现</title>
        <jsp:include flush="true" page="/common/header39.jsp"/>
        <link rel="stylesheet" type="text/css" href="/css39/bg_newsample_blue.css"/>
        <style>
            .date_style .date_td_con {
            }
    
            .date_style .date_td_con input {
                border: 1px solid #aaa;
                height: 26px;
                width: 120px;
                margin-left: 6px;
                padding-right: 5px;
                background-position-x: 110px;
            }
    
            .select_box_con2 {
                padding-right: 5px;
            }
    
            .date_style > div.date_td_con {
                margin-left: 3px !important;
                /*width: 236px !important;*/
                width: 94% !important;
            }
    
            .date_style > div.date_td_con > div > input#value_T_AA_WO05- {
                width: 100%;
                margin-left: 0px;
                background-position-x: 99%;
            }
    
            .date_style > div.date_td_con > div > input#value_T_AA_WO04- {
                width: 100%;
                margin-left: 0px;
                background-position-x: 99%;
            }
    
            .rebut-box {
                width: 300px;
                margin: 0 auto;
                padding: 8px 0;
                overflow: hidden;
            }
    
            .rebut-box a {
                margin: 0 2px;
            }
    
            .rebut-box a:hover {
                position: relative;
                top: 1px;
            }
        </style>
        <%
            if (css != null) {
        %>
        <link href="/feReport/css/<%=css%>?v=100011" rel="stylesheet" type="text/css"/>
        <%
            }
        %>
    
    
        <script type="text/javascript" charset="utf-8" src="/js39/flyrise.height.config.js"></script>
        <script type="text/javascript">
            var searchHtmls = new Array();
        </script>
    </head>
    
    <body>
    <iframe id="downloadwindow" name="downloadwindow" style="display:none;" src=""></iframe>
    <div class="wrap">
        <div class="content">
            <!-- Begin::按钮TOOLBAR -->
            <div class="toolbar_width" style="height:50px; width:100%; border-bottom:1px solid #ccc;">
                <ul class="toolbar_list">
                    <%
                        if (chartNumber > 0) { //有图表
                    %>
                    <li>
                        <a href="javascript:showChart(<%=reportId%>);" class="styleLightBgColor styleHoverBgColor"
                           tabindex="-1" id='SYS_BUTTON_add'>图表查看</a>
                    </li>
                    <li class="toolbar_line_bg">
                            <%
    			    }else{
    			%>
                    <li>
                        <%
                            }
                        %>
                        <a tabindex="-1" class="styleLightBgColor styleHoverBgColor" id='SYS_BUTTON_Pdf'
                           onclick="exp_print_choose('pdf');">Pdf打开</a>
                    </li>
                    <li class="toolbar_line_bg">
                        <a tabindex="-1" class="styleLightBgColor styleHoverBgColor" id='SYS_BUTTON_Excel'
                           onclick="exp_print_choose('excel');">Excel打开</a>
                    </li>
                    <li class="toolbar_line_bg">
                        <a tabindex="-1" class="styleLightBgColor styleHoverBgColor" id='SYS_BUTTON_Print'
                           onclick="exp_print_choose('<%=reportId%>');">打印报表</a>
                    </li>
                </ul>
            </div>
            <!-- End::按钮TOOLBAR -->
            <%
                int iCondition = 0; //查询条件个数
                String finds[] = server.getReportFind(reportId); //报表数据(选择字段RI04,是否查询RI21,字段中文名RI05,数据类型RI39,表名RI02,字段格式RI20,格式的隐藏值RI58)
                String searchFields = ""; //?
                if (finds != null && finds.length > 1) {
                    String fields[] = finds[0].split("`"); //字段列表
                    String ifCondition[] = finds[1].split("`"); //是否查询条件 1-是查询条件
                    String fieldNames[] = null;
                    if (finds.length > 2 && finds[2] != null) {
                        fieldNames = finds[2].split("`");
                    }
                    String fty[] = null; //字段类型 (DATE / NUMBER / ……)
                    if (finds.length > 3 && finds[3] != null)
                        fty = finds[3].split("`");
                    String foramts[] = null; //格式 (C, DYYYY-MM-DD, [100000] ……)
                    if (finds.length > 5 && finds[5] != null)
                        foramts = finds[5].split("`");
                    String ri58[] = null;
                    if (finds.length > 6 && finds[6] != null)
                        ri58 = finds[6].split("`");
            %>
            <form action="/client/clientReport/retireReport/clientSearch.jsp" id="searchForm" method="post">
                <div class="search_bg" id="sendApproveDivNew">
                    <div class="graph_search" id="searchdivs">
                        <input type="hidden" name="reportId" value="<%=reportId%>">
                        <input type="hidden" name="cpage" value="<%=cpage%>">
                        <input type="hidden" name="filter" id="filter" value="<%=filter == null ? "" : filter%>">
                        <input type="hidden" name="finds" value="<%=finds[0]%>">
                        <input type="hidden" name="newCell" id="newCell" value="<%=newCell == null ? "" : newCell%>">
                        <input type="hidden" name="dataType" value="<%=server.getReportFieldSet(reportId).getString("dataType")%>">
                       <%-- <input type="hidden" name="selectFields" value="1,1">
                        <input type="hidden" name="selectNames" value="2,2">--%>
    
                        <!-- Begin::查询条件 -->
                        <table width="100%" border="0" cellspacing="1" cellpadding="1" id="filterTable">
                            <tr id="tr0">
                                <%
                                    int nc = newCell != null && !"".equals(newCell) ? Integer.parseInt(newCell) + 1 : 0;
                                    int i = 0; //
                                    int km = 0; //
                                    int totalItems = fields.length + nc; //共有多少字段
                                    int firstCondition = 0;
                                    String firstFields = null;
                                    while (km < totalItems) {
                                        if (km >= fields.length) { //?
                                            i = firstCondition;
                                        } else {
                                            i = km;
                                        }
                                        if ("1".equals(ifCondition[i])) {//设置要查询
                                            if (iCondition == 0) {
                                                firstCondition = km;
                                                firstFields = fields[km];
                                            }
                                            if (km < fields.length)
                                                searchFields = searchFields + "`" + fields[i];
                                            String tit = "未知项";
                                            if (fieldNames != null)
                                                tit = fieldNames[i];
                                            String filterType = (km >= fields.length ? "_" + (km - fields.length) : ""); //?
                                %>
                                <td style="width:20px">&nbsp;</td>
                                <td id="id_<%=fields[i] + filterType%>"
                                        <%="".equals(filterType) ? "" : "filterType=" + (km - fields.length)%>
                                    align="<%=iCondition % 2 == 0 ? "right" : "left"%>"
                                    style="height:30px;">
                                    <table width="100%">
                                        <tr>
                                            <!-- Begin::字段下拉 -->
                                            <td class="combo_style select_box_con2" style="width: 111px;">
                                                <%
                                                    Map fieldMap = new LinkedHashMap();
                                                    Tag tag = new Tag(); //样式
                                                    ClientTag clientTag = new ClientTag();
                                                    int gi = -1;
                                                    String defaultValue = "";
                                                    for (int j = i; j < fields.length; j++) {
                                                        String tm = "未知项";
                                                        if (fieldNames != null)
                                                            tm = fieldNames[j];
                                                        if (j >= ifCondition.length || !"1".equals(ifCondition[j])) //非查询条件
                                                            continue;
                                                        String fd = request.getParameter("field_" + fields[i] + filterType);
                                                        boolean flat = false;
                                                        if (fd != null) {
                                                            if (fields[j].equals(fd)) {
                                                                flat = true;
                                                                gi = j;
                                                                defaultValue = fd;
                                                            }
                                                        } else {
                                                            if (fields[i].equals(fields[j])) {
                                                                flat = true;
                                                                gi = j;
                                                                defaultValue = fields[i];
                                                            }
                                                        }
                                                        fieldMap.put(fields[j], tm);
                                                    }
                                                    fieldMap.put("field", "field_" + fields[i] + filterType);
                                                    fieldMap.put("defauleHideValue", defaultValue);
                                                    fieldMap.put("defauleShowValue", fieldMap.get(defaultValue));
                                                    fieldMap.put("onchange", "showData(this)");
                                                    fieldMap.put("change", "showData(this)");
                                                    //out.print(tag.getCustomCombo(fieldMap));
                                                    out.print(clientTag.getCustomCombo(fieldMap));
                                                    fieldMap.clear();
                                                    String tfd = request.getParameter("type_" + fields[i] + filterType);
                                                    String ffd = request.getParameter("format_" + fields[i] + filterType);
                                                %>
    
                                            </td>
                                            <!-- End::字段下拉 -->
    
                                            <!-- Begin::操作符下拉 -->
                                            <td align="left" style="width: 82px;" class="combo_style">
    
                                                <input type="hidden" name="type_<%=fields[i] + filterType%>"
                                                       value="<%=tfd != null && !"".equals(tfd.trim()) ? tfd : (fty != null ? fty[i] : "")%>">
                                                <input type="hidden" name="format_<%=fields[i] + filterType%>"
                                                       value="<%=ffd != null && !"".equals(ffd.trim()) ? ffd : (foramts != null && !"".equals(foramts[i].trim()) ? foramts[i] : "")%>">
                                                <%
                                                    String oper = request.getParameter("oper_" + fields[i] + filterType);
                                                    if (oper == null)
                                                        oper = "=";
                                                    Map operMap = new LinkedHashMap();
                                                    operMap.put("=", "等于");
                                                    operMap.put("like", "包含");
                                                    operMap.put("not like", "不包含");
                                                    operMap.put("<>", "不等于");
                                                    operMap.put(">", "大于");
                                                    operMap.put(">=", "大于等于");
                                                    operMap.put("<", "小于");
                                                    operMap.put("<=", "小于等于");
                                                    operMap.put("null", "为空");
                                                    operMap.put("not null", "不为空");
                                                    operMap.put("field", "oper_" + fields[i] + filterType);
                                                    operMap.put("defauleHideValue", oper);
                                                    operMap.put("defauleShowValue", operMap.get(oper));
                                                    out.print(tag.getCustomCombo(operMap));
                                                    operMap.clear();
                                                %>
                                            </td>
                                            <!-- End::操作符下拉 -->
    
                                            <!-- Begin::值输入或选择 -->
                                            <td align="left">
                                                    <%
    										    	String v = request.getParameter("value_" + fields[i] + filterType);
    							                    char a = foramts[gi].charAt(0);
    							                    tag.setName("value_" + fields[i] + filterType);
    							                    if (v != null && foramts[i].charAt(0) == 'D' && v.length() > foramts[i].length())
    							                        v = v.substring(0, foramts[i].length() - 1);
    							                    String htmls = "";
    							                    if (a == '[') {
    							                        tag.setFormat("C");
    							                        tag.setPrompt(foramts[gi]);
    							                        htmls = tag.getOrganizeTreeTag() + "<input type=\"hidden\" name=\"orgType\">";
    							                    } else if (a == 'D') {
    							                        tag.setFormat(foramts[gi]);
    							                        htmls = tag.getDateTag() + "<input type=\"hidden\" name=\"dateType\">";
    							                    } else if (a != 'C' && a != 'N' && a != 'P') {
    							                        tag.setFormat("C");
    							                        tag.setPrompt(foramts[gi]);
    							                        DataTable dt = DataPool.getDataTable(foramts[gi]);
    							                        if(dt != null && dt.getTotalRow() > 30){
    							                            tag.setPop(true);
    							                            request.setAttribute("current",1);
    							                            request.setAttribute("pagesize",35);
    							                        }
    							                        htmls = tag.getComboTag() + "<input type=\"hidden\" name=\"comboType\">";
    							                    } else {
    							                        tag.setFormat("C");
    							                        htmls = tag.getTextTag() + "<input type=\"hidden\" name=\"textType\">";
    							                    }
    										%>
                                                    <%=htmls%>
    
                                                <!-- End::值输入或选择 -->
                                        <td align="left">
                                            <input type="checkbox" onclick="selectField()" id="<%="a." + fields[i]%>" name="<%=tit%>" checked="true" style="margin-top: 12px;">
                                        </td>
                                        </tr>
    
    
                                    </table>
                                </td>
                                <%
                                    if (iCondition > 0 && iCondition % 2 == 1) { //隔开、换行
                                %>
                                <td style="width:20px"> &nbsp;</td>
                            </tr>
                            <tr>
                                <%
                                            }
                                            iCondition++;
                                        }
                                        km++;
                                    }
                                %>
                            </tr>
                        </table>
                        <!-- End::查询条件 -->
    
                        <%
                            if (iCondition > 0) {
                        %>
                        <div class="rebut-box">
                            <a href="javascript:formSubmit(1);" class="auto_btn styleLightBgColor styleHoverBgColor"
                               title="立即查找"><span>立即查找</span></a>
                           <%-- <a href="javascript:addFilter('<%=firstFields%>');"
                               class="auto_btn styleLightBgColor styleHoverBgColor" title="增加查询条件"><span>增加查询条件</span></a>--%>
                            <a href="javascript:clearFilter('<%=firstFields%>');"
                               class="auto_btn styleLightBgColor styleHoverBgColor" title="清空查询条件"><span>清空查询条件</span></a>
                        </div>
                        <%
                            }
                        %>
                    </div>
                </div>
               <%-- <div class="hiddenApproveDiv">
                    <a href="javascript:changeSendApproveDiv(this);" id="hiddenApproveBar"
                       class="hiddenApproveDiv_bardown_btn" title="展开查询条件"></a>
                </div>--%>
                <input type="hidden" name="addField" value="<%=firstFields%>"/>
            </form>
            <%
                }
            %>
            <div class="graph_table" id="dataDiv" Style="WIDTH: 928px; HEIGHT: 100%; OVERFLOW-y: hidden;">
                <%
                    try {
                        long startt = System.currentTimeMillis();
                        int cp = (cpage == null || "0".equals(cpage) ? 1 : Integer.parseInt(cpage));
                        UserVO user = UserSession.get(request);
                        //html = createServer.createReportInfo(reportId, cp, cp, filter, user);
                        html = clientReportCreatServer.createReportInfo(reportId, cp, cp, filter, user , selectNameArray , selectFieldArray);
                        long endt = System.currentTimeMillis();
                        LogUtils.info("报表用时:" + ((endt - startt) / 1000) + "秒");
                    } catch (SysException e) {
                        request.setAttribute("error", e.getMessage());
                        throw e;
                    } catch (Exception e) {
                        LogUtils.error(e);
                        request.setAttribute("error", "报表数据查询出错,请联系管理员");
                        throw new SysException("报表数据查询出错,请联系管理员");
                    }
                    if (html.startsWith("ERROR")) {
                %>
                <div class="graph_table">
                    <div class="error">
                        <div class="error_top"></div>
                        <div class="error_mid"><%=html.replace("ERROR:", "")%>
                        </div>
                        <div class="error_bot"></div>
                    </div>
                </div>
                <%
                } else {
                %>
                <%=html%>
                <%
                    }
                %>
            </div>
    
            <ul class="bottom_page" style="position:relative;">
                <li>记录总数:<span class="red" id="totalField"><%=total[0]%></span>条</li>
                <%
                    if (total[0] > 0) {
                %>
                <li><%=cpage%>/<%=total[1]%>页</li>
                <%
                    if (total[1] > 1 && Integer.parseInt(cpage) > 1) {
                %>
                <li><a href="javascript:toPage(1);"><img src="/feReport/images/frist_max.gif"></a></li>
                <li><a href="javascript:toPage(2);"><img src="/feReport/images/left_per.gif"></a></li>
                <%
                } else {
                %>
                <li><img src="/feReport/images/top_gray.gif"></li>
                <li><img src="/feReport/images/privous_gray.gif"></li>
                <%
                    }
                %>
                <li><select name="" onchange="toPage(5)">
                    <%
                        for (int i = 1; i <= total[1]; i++) {
                    %>
                    <option <%=i == Integer.parseInt(cpage) ? "selected" : ""%> value="<%=i%>">第<%=i%>页</option>
                    <%
                        }
                    %>
                </select>&nbsp;
                </li>
                <%
                    if (total[1] > 1 && Integer.parseInt(cpage) < total[1]) {
                %>
                <li><a href="javascript:toPage(3);"><img src="/feReport/images/right_next.gif"></a></li>
                <li><a href="javascript:toPage(4);"><img src="/feReport/images/last_max.gif"></a></li>
                <%
                } else {
                %>
                <li><img src="/feReport/images/next_gray.gif"></li>
                <li><img src="/feReport/images/bottom_gray.gif"></li>
                <%
                        }
                    }
                %>
            </ul>
        </div>
    </div>
    
    <form action="/feReport/showChart.jsp" name="chartForm" id="chartForm">
        <input type="hidden" value="<%=reportId%>" name="reportId">
        <input type="hidden" value="<%=filter == null ? "" : filter%>" name="filter">
    </form>
    <%
        if (iCondition == 1) {
    %>
    <script>
        if (document.getElementById("tr0") != null) {
            var cell = document.getElementById("tr0").cells[1];
            if (cell != null)
                cell.align = "center";
        }
    </script>
    <%
        }
    %>
    
    
    <script type="text/javascript">
    
        window.onload = function displaySearch() {
            //alert("-----------");
            changeSendApproveDiv(null);
        }
    
        var totalField = $("#totalField");
        function formSubmit(t) {
            if (t == 1) {
                $("input[name=cpage]").val(0);
            }
    
            //拿到所选的字段中文名和字段名
            var selectNames = [];
            var selectFields = [];
            $(function(){
                $("#searchForm").find(":checkbox:checked").each(function(){
                    var selectName = $(this).attr('name');
                    console.log('-----val----' + selectName);
                    selectNames.push(selectName);
                    var selectField = $(this).attr('id');
                    console.log('-----val----' + selectField);
                    selectFields.push(selectField);
                });
            });
            selectNames = selectNames.toString();
            selectFields = selectFields.toString();
            console.log('-----selectNames----' + selectNames);
            console.log('-----selectFields----' + selectFields);
            if (selectNames.length <= 0){
                top.FETOP.Dialog.warn("查询字段不能为空,请选择字段进行报表查询");
                return false;
            }
            console.log("-----action----" + $("form:eq(0)").attr("action"));
            var newaction  = $("form:eq(0)").attr("action") + "?selectNames=" + selectNames + "&selectFields=" + selectFields;
            $("#searchForm").attr("action",newaction);
            $("#searchForm").submit();
        }
        //选择字段时变换相应的文本框
        function showData(obj) {
            obj = $(obj).prev();
            var idobj = $(obj).parent().parent().parent().parent().parent().parent().parent();
            var vid = $(idobj).attr("id").replace("id_", "");
            for (var i = 0; i < fields.length; i++) {
                if (fields[i] == $(obj).val()) {
                    searchHtmls[i] = searchHtmls[i].replace(new RegExp("_" + $(obj).val(), "gm"), "_" + vid);
                    $(idobj).html(searchHtmls[i]);
                    break;
                }
            }
            setTagTdClass();
        }
    
        //分页处理
        var total =<%=total[1]%>;
        var cp =<%=cpage%>;
        function toPage(p) {
            if (total > 0) {
                if (p == 1) {
                    $("input[name=cpage]").val(1);
                } else if (p == 2) {
                    if (cp > 1) {
                        $("input[name=cpage]").val(cp - 1);
                    }
                    else {
                        $("input[name=cpage]").val(1);
                    }
                } else if (p == 3) {
                    if (cp >= total) {
                        $("input[name=cpage]").val(total);
                    }
                    else {
                        $("input[name=cpage]").val(cp + 1);
                    }
                } else if (p == 4) {
                    $("input[name=cpage]").val(total);
                } else {
                    var evt = window.event || arguments.callee.caller.arguments[0];//兼容火狐浏览器 woky 2015.10.29
                    var obj = evt.srcElement ? evt.srcElement : evt.target;//兼容火狐浏览器 woky 2015.10.29
                    $("input[name=cpage]").val(obj.value);
                }
                formSubmit(2);
            }
        }
        var chartNumber =<%=chartNumber%>;
        function showChart(id) {
            if (chartNumber > 0)
            //window.location.href='/feReport/showChart.jsp?reportId=<%=reportId%>';
                document.getElementById("chartForm").submit();
            else {
                top.FETOP.Dialog.warn("没有配置统计图表");
                return;
            }
        }
        //导出打印弹出选择页码框
        function exp_print_choose(type) {
            var url = "/feReport/print_exp.jsp?type=" + type;
            if (total != null)url = url + "&total=" + total;
            Dialog.show({
                id: 'expPrintChoose',
                title: '报表下载',
                url: url,
                draggable: true,
                maxable: false,
                closable: true,
                scroll: 'no',
                width: 600,
                height: 250,
                fromWindow: window,
                closeAction: function (dialog) {
                    var va = dialog.iframe.returnValue;
                    if (va == null) return false;
                    if (type == 'pdf') {
                        getDownloadUrl(type, va);
                    } else if (type == 'excel') {
                        getDownloadUrl(type, va);
                    } else {
                        showPrint(type, va);
                    }
                }
            });
        }
        //导出数据
        function getDownloadUrl(type, va) {
            var res = "/FileDownload?from=report&outtype=" + type + "&expPage=" + va;
            var filter = document.getElementById("filter");
            try {
                res += "&reportId=<%=reportId%>";
                res += "&filter=" + encodeURI(filter.value); //modified by lw 需要动态加载iframe 时,get请求传递中文时,必须调用encodeURI(),处理乱码问题。
            } catch (e) {
                top.FETOP.Dialog.warn(e.message);
            }
            document.getElementById('downloadwindow').src = res;
        }
    
        function showPrint(reportId, va) {
            var filter = document.getElementById("filter");
            openInfo("/feReport/print.jsp?reportId=" + reportId + "&printPage=" + va + "&filter=" + encodeURI(filter.value), "veryBig", "h");//含特殊字符,用encodeURI(filter)处理,否则filter的值传递不了.
        }
    
        function openInfo(url, page, x) {
            var width = 0;
            var height = 0;
            if (page == 'big') {
                if (x != "v") {
                    width = 750;
                    height = 500;
                } else {
                    width = 500;
                    height = 700;
                }
            }
            else if (page == 'veryBig') {
                if (x != "v") {
                    width = 1200;
                    height = 600;
                } else {
                    width = 600;
                    height = 900;
                }
            }
            else if (page == 'middle') {
                if (x != "v") {
                    width = 500;
                    height = 350;
                } else {
                    width = 350;
                    height = 500;
                }
            }
            else if (page == 'small') {
                if (x != "v") {
                    width = 400;
                    height = 250;
                } else {
                    width = 250;
                    height = 400;
                }
            }
            else if (page == 'tiny') {
                if (x != "v") {
                    width = 200;
                    height = 150;
                } else {
                    width = 200;
                    height = 150;
                }
            }
            showx = (screen.availWidth - width) / 2;
            showy = (screen.availHeight - 10 - height) / 2;
            var r = window.open(url, "", "height=" + height + ",width=" + width + ",top=" + showy + ",left=" + showx + ",scrollbars=1");
        }
        var bdheight = 0;
        var offy = 0;
        //计算DIV的可见大小
        function resize_divBody(div) {
            if (document.all[div]) {
                var divObj = document.all[div];
                //alert(document.body.clientHeight)
                if (document.body.clientHeight && divObj != null) {
                    var bodyHeight = document.body.clientHeight;
                    var bodyWidth = document.body.clientWidth;
                    var offsetY = getObjOffSetY("filterTable");
                    var offsetX = getObjOffSetX(div);
                    //alert(offsetY);
                    divObj.style.width = bodyWidth - offsetX;
                    divObj.style.height = bodyHeight - offsetY - 25;
                    bdheight = bodyHeight;
                    offy = offsetY;
                }
            }
        }
    
        /**
         * 获取传入对象的绝对Top坐标
         * @param objName 对象的名称
         * @author woky
         */
        function getObjOffSetY(objName) {
            var offsetY = 0;
            var obj = document.all[objName];
            if (!obj) {
                return 0;
            }
            while (obj && obj.tagName != "BODY") {
                offsetY += obj.offsetTop;
                obj = obj.offsetParent;
            }
            return offsetY;
        }
    
        /**
         * 获取传入对象的绝对Left坐标
         * @param objName 对象的名称
         * @author woky
         */
        function getObjOffSetX(objName) {
            var offsetX = 0;
            var obj = document.all[objName];
            if (!obj) {
                return 0;
            }
            while (obj && obj.tagName != "BODY") {
                offsetX += obj.offsetLeft;
                obj = obj.offsetParent;
            }
            return offsetX;
        }
        //resize_divBody("dataDiv");
        resizeTabHeight();
    
        function divWidthHieght() {
            if (document.all['dataDiv']) {
                var divObj = document.all['dataDiv'];
                if (document.body.clientHeight) {
                    var bodyHeight = document.body.clientHeight;
                    var bodyWidth = document.body.clientWidth;
                    var offsetY = getObjOffSetY('dataDiv');
                    var offsetX = getObjOffSetX('dataDiv');
                    var wh = [bodyWidth - offsetX, bodyHeight - offsetY - 20];
                    return wh;
                }
            }
        }
    
    
        //展开或收缩查询DIV
        var shflag = false;
        function changeSendApproveDiv(src) {
    
            $("#sendApproveDivNew").show();
    
           /* var obj = $("#hiddenApproveBar");
            var sendDivObj = $("#sendApproveDivNew");
            if (!shflag) {
                $("#sendApproveDivNew").show();
                $("#hiddenApproveBar").attr("class", "hiddenApproveDiv_bar_btn");
                $("#hiddenApproveBar").attr("title", "隐藏查询条件");
                shflag = true;
            }
            else {
                $("#sendApproveDivNew").hide();
                $("#hiddenApproveBar").attr("class", "hiddenApproveDiv_bardown_btn");
                $("#hiddenApproveBar").attr("title", "展开查询条件");
                shflag = false;
            }*/
            resizeTabHeight();
        }
        //如果没有数据添加空白行
        var reportTable = document.getElementById("report1");
        reportTable = null;
        if (reportTable != null) {
            if (reportTable.rows.length < 10) {
                var whh = divWidthHieght();
                var c = reportTable.rows.length * 30;
                while (whh != null && c < whh[1]) {
                    var tr = reportTable.insertRow();
                    var cn = 1;
                    if (reportTable.rows.length > 0)cn = reportTable.rows[0].cells.length;
    
                    for (var k = 0; k < reportTable.rows[0].cells.length; k++) {
                        tr.insertCell();
                    }
                    c = c + 30;
                }
    
            }
        }
        var filter =<%=filter != null && !"".equals(filter.trim()) ? 1 : 0%>;
        if (filter == 1) {
            changeSendApproveDiv(null);
        }
        var newCell =<%=newCell == null || "".equals(newCell) || "null".equals(newCell) ? "-1" : newCell%>;//记录新加条件个数
        var tr = null;//复制的行
        var firstTr = null;//被复制的行
        var bdheight = 0;
        var offy = 0;
        var flat = true;
        var lasth = 0;
        //增加查询条件
        function addFilter(firstFields) {
            var tb = document.getElementById("filterTable");
            if (tb.rows.length > 0) {
                firstTr = tb.rows[0];
                tr = tb.rows[tb.rows.length - 1];//最后一行
                if (tr.cells.length <= 0 && tb.rows.length > 1) {
                    tr = tb.rows[tb.rows.length - 2];//
                }
                if (tr != null) {
                    newCell = newCell + 1;
                    if (tr.cells.length > 2 && tr.cells.length <= 5) {
                        var newtr = tb.insertRow();
                        processCell(newtr, firstTr, firstFields);
                        if (flat)resize_divBody("dataDiv");
                        if (bdheight / offy >= 2) {
                            flat = false;
                            //if(lasth==0)lasth=offy-40;
                            //document.getElementById("sendApproveDivNew").style.height=lasth;
    
                        }
                    } else {
                        processCell(tr, firstTr, firstFields);
                    }
    
                    document.getElementById("newCell").value = newCell;
                    //add by lw. 2014/09/05 begin
                    var $newVau = $("#" + "id_" + firstFields + "_" + newCell).find("input[name=" + "value_" + firstFields + "]");
                    var $newVau2 = $("#" + "id_" + firstFields + "_" + newCell).find("input[name=" + "value_" + firstFields + "-]");
                    if ($newVau[0]) {
                        $newVau.val('');
                    }
                    if ($newVau2[0]) {
                        $newVau2.val('');
                    }
                    //end
                }
                resizeTabHeight();
            }
        }
        //新加条件的的名字规则是在原名字前加多序号
        function processCell(newtr, tr, firstFields) {
            var cell1 = newtr.insertCell();
            cell1.innerHTML = tr.cells[0].innerHTML;
            var cell2 = newtr.insertCell();
            cell2.innerHTML = tr.cells[1].innerHTML;
            if (newtr.cells.length <= 2)cell2.align = tr.cells[1].align;
            else cell2.align = "left";
            cell2.id = "id_" + firstFields + "_" + newCell;
            cell2.filterType = newCell;
            var child = cell2.children;
            for (var i = 0; i < child.length; i++) {
                if (child[i].name != null && child[i].type.toLowerCase() != "button") {
                    child[i].name = child[i].name + "_" + newCell;
                    child[i].id = child[i].id + "_" + newCell;
                    if (child[i].tagName.toLowerCase() == "select") {
                        child[i].filterType = "1";
                    }
                }
            }
            //获取cell2.id下的所有input 域
            if (newCell != null && newCell >= 0) {
                var inputs = document.getElementById(cell2.id).getElementsByTagName("input");
                for (var i = 0; i < inputs.length; i++) {
                    var inp = inputs[i];
                    if (inp.id != null && inp.id != "") {
                        var attrOnclick = $('#'+inp.id).attr('onclick');
                        var regId=new RegExp(inp.id);
                        var regName=new RegExp(inp.name);
                        if (inp.id.charAt(inp.id.length - 1) == "-") {
                            inp.id = inp.id.substr(0, inp.id.length - 1) + "_" + newCell + "-";
                            inp.name = inp.name.substr(0, inp.name.length - 1) + "_" + newCell + "-";
                        } else {
                            inp.id = inp.id + "_" + newCell;
                            inp.name = inp.name + "_" + newCell;
                        }
                        if (attrOnclick && attrOnclick.indexOf("showOrgSelect('/organizeTree/selectOrganizeTree.jsp?") > -1) {//解决报表页面组织机构增加查询条件后无法正确选择条件问题
                            attrOnclick = attrOnclick.replace(regId, inp.id).replace(regName, inp.name);
                            $('#' + inp.id).attr('onclick', attrOnclick);
                        }
                    }
                }
            }
        }
        var searchFields = "<%=searchFields != null && searchFields.length() > 0 ? searchFields.substring(1) : ""%>";
        var sf = searchFields.split("`");
        var fields = new Array();
        for (var i = 0; i < sf.length; i++) {
            if (sf[i] != "") {
                fields.push(sf[i]);
                searchHtmls.push(document.getElementById("id_" + sf[i]).innerHTML);
            }
        }
        //清空查询条件
        function clearFilter(firstFields) {
            var filterTable = document.getElementById("filterTable");
            var delRows = new Array();
            if (filterTable != null) {
                var rows = filterTable.rows;
                for (var i = 0; i < rows.length; i++) {
                    var mk = 0;
                    var cells = rows[i].cells;
                    var cs = cells.length;
                    var spaceCell = new Array();
                    for (var j = 0; j < cells.length; j++) {
                        if (j == 1 || j == 3) {
                            if (cells[j].filterType != null) {
                                var child = cells[j].children;
                                for (var ii = child.length - 1; ii >= 0; ii--) {
                                    cells[j].removeChild(child[ii]);
                                }
                                spaceCell.push(j - 1);
                                spaceCell.push(j);
                                mk++;
                            } else {
                                $(cells[j]).find("tr td:eq(2)").find("input").val("");
                            }
                        }
                    }
                    for (var ck = spaceCell.length - 1; ck >= 0; ck--) {
                        rows[i].deleteCell(spaceCell[ck]);
                    }
                    if (mk == 2 || (cs == 2 && mk == 1)) {
                        delRows.push(i);
                    }
                }
                for (var i = delRows.length - 1; i >= 0; i--) {
                    filterTable.deleteRow(delRows[i]);
                }
                for (var i = 0; i < rows.length; i++) {
                    var cells = rows[i].cells;
                    for (var j = 0; j < cells.length; j++) {
                        if (rows.length == 2 && cells.length == 2 && j == 1 && cells[j].align == "right") {
                            cells[j].align = "center";
                        }
                    }
                }
                document.getElementById("filter").value = "";
                document.getElementById("newCell").value = "";
            }
            document.getElementById("sendApproveDivNew").style.height = null;
            resize_divBody("dataDiv");
        }
    
    
    </script>
    <script>
        //画线---------------------
        var line_left, line_top, line_width, line_height;
        function getBounds(obj) {
            var objLeft = obj.offsetLeft;
            var objTop = obj.offsetTop;
            var objHeight = obj.offsetHeight;
            var objWidth = obj.offsetWidth;
            var objParent = obj.offsetParent;
            while (objParent.tagName.toUpperCase() != "BODY") {
                objLeft += objParent.offsetLeft;
                objTop += objParent.offsetTop;
                objParent = objParent.offsetParent;
            }
            line_width = objWidth;
            line_height = objHeight;
            line_left = objLeft;
            line_top = objTop;
        }
    
        /*
         *    程序效果:Javascript js 画线、画点、曲线图封装类
         *    程序设计:lxs_lingting 11-11-25
         *    邮箱:525909366@qq.com
         *    个人主页:http://www.xiaolanhu.com/
         */
        /*
         *    11-12-12 修改
         *    当横坐标差值与纵坐标差值相差太多时程虚线
         */
    
    
        //主调 set_line(x1,y1[,x2,y2,title])
        function draw_line(id) {
            this.o = document.getElementById(id);
            this.k = null;
            this.b = null;
            this.l = 0;
            this.t = 0;
            this._max = 1;//线条的粗细
            this._color = "#cccccc";//线条颜色
            this.get_offset();//获取主层位置
            this.state = true;//给予的坐标是否相对于当前层 默认为true
        }
    
        //获取公式参数值
        draw_line.prototype.get_gs = function (x1, y1, x2, y2) {
            this.k = (y1 - y2) / (x1 - x2);
            this.b = y1 - (y1 - y2) / (x1 - x2) * x1;
            this.k = this.k ? this.k : 0;
            this.b = this.b ? this.b : 0;
        }
    
        //获取y坐标 y=kx+b x=(y-b)/k
        draw_line.prototype.get_y = function (x) {
            return this.k * x + this.b;
        };
    
        //获取x坐标
        draw_line.prototype.get_x = function (y) {
            return (y - this.b) / this.k;
        };
    
    
        //获取主层位置
        draw_line.prototype.get_offset = function () {
            var obj = this.o;
            this.l = obj.offsetLeft, this.t = obj.offsetTop;
            if (document.all) {
                this.l += 11;
                while (obj.parentNode && obj.parentNode.tagName != "BODY") {
                    obj = obj.parentNode;
                    this.l += obj.offsetLeft;
                    this.t += obj.offsetTop;
                }
            }
        }
    
        //生成点
        draw_line.prototype.set_div = function () {
            var _x = arguments[0], _y = arguments[1];
            var div = document.createElement("div");
            if (!document.all) {
                this.get_offset();
            }
            if (this.state) {
                _x += this.l;
                _y += this.t;
            }
            with (div.style) {
                line_width = this._max + "px";
                line_height = this._max + "px";
                backgroundColor = this._color;
                position = "absolute";
                overflow = "hidden";
                line_left = _x + "px";
                line_top = _y + "px";
                zIndex = 99999;
            }
            //if(arguments.length==3 && arguments[2]){
            if (arguments[2]) {
                //div.title=arguments[2];
                div.style.cursor = "pointer";
                div.style.zIndex = 100000;
                var c = div.style.backgroundColor;
                div.onmouseover = function () {
                    this.style.backgroundColor = "#0000ff";
                };
                div.onmouseout = function () {
                    this.style.backgroundColor = c;
                };
            }
            document.body.appendChild(div);
        }
    
        //循环点成线
        draw_line.prototype.set_line = function () {
            var x1, y1, x2, y2, arg = arguments;
            if (arg.length == 4) {
                x1 = arg[0];
                y1 = arg[1];
                x2 = arg[2];
                y2 = arg[3];
            } else {
                x1 = x2 = arg[0];
                y1 = y2 = arg[1];
            }
            this.get_gs(x1, y1, x2, y2);
            if (x1 == x2 && y1 == y2) {
                this.set_div(x1 - Math.floor(this._max / 2), y1 - Math.floor(this._max / 2), arg[2]);
            } else {
                if (x1 == x2) {
                    for (var i = Math.min(y1, y2); i <= Math.max(y1, y2); i++) {
                        this.set_div(x1, i);
                    }
                } else {
                    if (x1 > x2) {
                        var _x = x1;
                        var _y = y1;
                        x1 = x2;
                        y1 = y2;
                        x2 = _x;
                        y2 = _y;
                    }
                    if (Math.abs(x1 - x2) > Math.abs(y1 - y2) || y1 == y2) {
                        for (var i = x1; i <= x2; i++) {
                            this.set_div(i, this.get_y(i));
                        }
                    } else {
                        for (var j = Math.min(y1, y2); j <= Math.max(y1, y2); j++) {
                            this.set_div(this.get_x(j), j);
                        }
                    }
                }
            }
        }
        //直角三角形的斜边长度
        function getSidelong(sideA, sideB) {
            var sidB2 = sideA * sideA + sideB * sideB;
            return Math.sqrt(sidB2);
        }
    
        function drawHeaderLine() {
            var dl = new draw_line("report1");
            //dl.state=false;//注释放开则给出的坐标按相对于body计算
            var table = document.getElementById("report1");
            var frow = null;
            if (table != null && table.rows.length > 0) {
                frow = table.rows[0];
            }
            var cell = null;
            if (frow != null && frow.cells.length > 0)cell = frow.cells[0];
            if (cell != null) {
                getBounds(cell);
                var rows = 1;
                if (cell.rowSpan != null && cell.rowSpan != "")rows = parseInt(cell.rowSpan);
                var cols = 1;
                if (cell.colSpan != null && cell.colSpan != "")cols = parseInt(cell.colSpan);
    
                var argHeight = height / rows;
                for (var i = 1; i <= rows; i++) {
                    dl.set_line(-12, 0, width - 11, argHeight * i);
                }
                var argWidth = width / cols;
                for (var i = 1; i < cols; i++) {
                    dl.set_line(-12, 0, argWidth * i + 10, height);
                }
            }
        }
        //drawHeaderLine();
        $(document).ready(function () {
            //处理查询字段控件样式
            setTagTdClass();
            resetwidth();
        });
    
        function resetwidth(){
            var table = $(".report_blue_tab");
            var tableW = table[0].scrollWidth;
            var fullWidth = document.body.offsetWidth;
            if(tableW > fullWidth) {
                var thWidth = 0;
                var header = $("tr:first", table);
                $("th", header).each(function (index) {
                    var actualW = this.scrollWidth;
                    if (actualW > 300) {
                        actualW = 300;
                        $("td:eq(" + index + ")", header.nextAll()).each(function () {
                            $(this).css({
                                "word-wrap": "break-word",
                                "word-break": "break-all",
                                "max-width": "300px",
                                "white-space": "normal"
                            });
                        });
                    }
                    thWidth += actualW;
                });
                if(thWidth > fullWidth){
                    table.css("width",thWidth);
                }
    
            }
        }
    
    
        function setTagTdClass() {
            $("#filterTable").find("input[name=orgType]").each(function () {
                $(this).parent().attr("class", "organizetree_style");
            });
            $("#filterTable").find("input[name=dateType]").each(function () {
                $(this).parent().attr("class", "date_style");
            });
            $("#filterTable").find("input[name=comboType]").each(function () {
                $(this).parent().attr("class", "combo_style");
            });
            $("#filterTable").find("input[name=textType]").each(function () {
                $(this).parent().attr("class", "text_style");
            });
        }
    
    
        function selectField() {
           /* debugger;
            //拿到所选的字段中文名和字段名
            var selectNames = [];
            var selectFields = [];
            $(function(){
                $("#searchForm").find(":checkbox:checked").each(function(){
                    var selectName = $(this).attr('name');
                    console.log('-----val----' + selectName);
                    selectNames.push(selectName);
                    var selectField = $(this).attr('id');
                    console.log('-----val----' + selectField);
                    selectFields.push(selectField);
                });
            });
            selectNames = selectNames.toString();
            selectFields = selectFields.toString();
            console.log('-----selectNames----' + selectNames);
            console.log('-----selectFields----' + selectFields);
            /!*if (selectNames.length <= 0){
                top.FETOP.Dialog.warn("查询字段不能为空,请选择字段进行报表查询");
                return false;
            }*!/
            $("#selectFields").val(selectFields);
            $("#selectNames").val(selectNames);*/
        }
    
    </script>
    </body>
    </html>
    

     

    展开全文
  • //增加的函数 begin function queryFun(){ var type = $("#artType").val(); var hasInputed = "1";//表示输入了要搜索 的信息 if($("#query").val()=="选手姓名/编号"){ //表示没有输入要搜索的值 hasInputed=...
  • 表单formaction和ajax使用情况区别

    千次阅读 2019-12-14 22:01:57
    action: ...form id="Userlogin" action="/users/login" method="post"> <input name="userName" type="text" id="UserName"/> <input name="password" type="password" id="password"/...

    action:

     <form id="Userlogin" action="/users/login" method="post">
           <input name="userName" type="text" id="UserName"/>
           <input name="password" type="password" id="password"/>
            <input type="submit" value="登录"> <input type="reset" value="重置">
        </form>
    

    注意:1:使用action,input要有name这个属性,传至后台。
    2:点击提交按钮找到/user/login这个控制器,数据传至后台,由后端控制跳转界面。
    3:action用于整个界面跳转变化,如:登录界面为单个界面,登录成功跳到另一个界面。
    4:默认请求方法是get,使用method来设置请求方法。

    ajax:

    <script type="text/javascript">
            function login() {
                $.ajax({
                    type: "POST",//方法类型
                    dataType: "json",//服务器返回的数据类型
                    url: "/users/login" ,//控制器url
                    data: $('#Userlogin').serialize(),
                    success: function (result) {
                        console.log(result);//测试是否有数据
                        if (result.resultCode == 200) {//200正确
                            alert("成功登陆!");
                           window.location.href = '跳转路径';//成功后跳转到某界面
                        }
                        ;
                    },
                    error : function() {
                        alert("登录失败!");
                    }
                });
            }
        </script>
    
     <form id="Userlogin" action="/users/login" method="post">
           <input name="userName" type="text" id="UserName"/>
           <input name="password" type="password" id="password"/>
            <input type="submit" value="登录" onClick="login()"> <input type="reset" value="重置">
        </form>
    

    注意:1:在提交按钮上要写点击事件login()。
    2:ajax异步传输可以只改变整个界面的一点点地方,替换页面局部HTML时使用。如:只是在右上角提交个登录小表单,这样能避免页面数据太大,更新整个界面的话时间长。
    3:请求类型type要写

    以上要感谢我的老师,把我的疑惑解开。以前action和ajax都写,所以增加产品界面一个弹出的表单能成功,而我写的登录成功跳转界面就跳转不了,也没有报错。老师看了我的代码说只执行了ajax,我才知道这两个是只执行一个。
    PS:我们老师真的超级厉害的,崇拜!!!!

    展开全文
  • formaction formmethod 该属性用于按钮(submit)让表单提交页面可又按钮控制 formmethod指定各按钮提交方式 placehoder 该属性非常有用,用于文本框中显示提示信息,非常有用的一属性 list list属性...
  • Html5之formaction属性

    千次阅读 2019-05-21 17:15:33
    Html5中,可以为所有的提交按钮,增加不同的formaction属性,使他点击不用的按钮时可以将表单提交到不同的页面。 代码参考: <!--原来的写法--> <form action="加上地址"> <button type=...

    Html5之formaction属性的简介:

    Html5中,可以为所有的提交按钮,增加不同的formaction属性,使他点击不用的按钮时可以将表单提交到不同的页面。

     

    代码参考:

    <!--原来的写法-->
    <form action="加上地址">
        <button type="submit">提交</button>
    </form>
    
    <!--现在 写法-->
    <form >
        <button type="submit" formaction="第1个按钮的提交地址">btn1</button>
        <button type="submit" formaction="第2个按钮的提交地址">btn2</button>
        <button type="submit" formaction="第3个按钮的提交地址">btn3</button>
    </form>
    

     

    展开全文
  • 关于django中form action的跳转问题

    千次阅读 2020-01-21 14:39:04
    ">{{warnings}}</p> {%endif%} <center>next is form</center> <form action="/data_record/contact/" method="get"> <p>Subject<input type="text" name="subject"></p> <p>your email(optional)...
  • Form表单Get方式提交时,action中带参数传递不了 &amp;amp;amp;lt;form id=”Formaction=”index.html?method=test” name=”Form”&amp;amp;amp;gt; &amp;amp;amp;lt;input name=”title” type=”...
  • form action="RollBackFormData_updateLook_success_supervision?id=${listy.teacherid }" method="post" name="form1"&gt; //表单数据... //我没有粘贴 &lt;input type...
  • html的form中动态添加action

    千次阅读 2016-03-31 09:49:57
    <form action="x" name="form1" > <input type="text" name="username" value="zhangsan" /> <input type="text" name="address" value="beijing" /> </form> <form action="x" name="form2" > </form> ...
  • 1、最新JQuery框架软件包下载 jquery.js压缩包 jquery.js非压缩包 2、Form插件下载 form.js 3、Form插件的简单入门 第一步:先增加一个表单 代码: 代码如下: <form id=”myForm” action=”comment.php” method...
  • 1. ActionAction类在MVC模式中发挥着控制器(Controller)的作用。Action类响应用户的动作,执行业务逻辑或调用其他类来执行业务逻辑,然后返回一个result用来告诉Struts应该呈现哪个视图。Struts2的Action类常常...
  • 增加 form 提交 element-form @submit.native.prevent <el-form @submit.native.prevent> <van-button type="info" @click="showActionSheet">弹出菜单</van-button> <van-actio...
  • 今天让一个页面增加一个确认的弹框… 想参照其他的页面,模仿着写,结果后来模仿了好久..都不对劲..因为他们都是使用的button.. 而唯独需要我操作增加确认弹框的,使用的form表单.. 在操作了多种复杂操作后,都一一...
  • 前端复习-form表单详解(1)

    千次阅读 2018-08-03 12:34:40
    form&amp;amp;gt; 元素 实例 &amp;amp;lt;form&amp;amp;gt; . form elements . &amp;amp;lt;/form&amp;amp;gt; HTML 表单包含表单元素。 表单元素指的是不同类型的 input 元素、复选框、...
  • // 自动,动态创建 form表单 function getUrl(URL, PARAMS) { ... temp.action = URL; temp.method = &quot;post&quot;; temp.style.display = &quot;none&quot;; if (PARAMS.length &am
  • According to TLD or attribute directive in tag file, attribute action does not accept any expressions
  • jq form提交 和 向标签中添加属性

    千次阅读 2019-07-10 18:34:02
    <body>...form id="form" method="post"> 用户ID:<input type="text" name="userId" value="${user.userId}" readonly="readonly"/> 用户姓名:<input type="text" name="userNam...
  • 提交form表单无法携带cookie问题解决方案

    千次阅读 热门讨论 2020-11-26 11:45:23
    解决方案一、问题背景二、解决...具体细节就不说了,大致是我上传头像使用提交form表单的方式,且后台业务逻辑本身需要依赖cookie实现,但form表单无法携带cookie。 二、解决方案 1、手动获取该域名下所有cookie  
  • 表单内容需进行验证及必填项提示,图片需要和信息一起传递且图片载入后需可预览。既然是注册我们当然是用form表单来提交了,对应的ElementUI组件标签则是el-form。...el-form中的model用来绑定表单数据对象
  • form表单的属性

    千次阅读 2019-11-21 17:37:00
    form表单HTML标签、属性、属性值: (单行文本输入框) ...(单选框) (多选框) (提交按钮) (重置按钮) 或者按钮(空按钮) ... 1:name=”” form中的name属性主要是对这个form进行标记; 2:m...
  • HTML form表单新增元素

    千次阅读 2017-08-30 21:44:50
    4表单相关新增元素和属性 4.1表单元素新增和废弃的属性  ...提交类:提交服务器设置的相关属性,formactionformmethod,formtype 控制类:required、autofocus、labels。 4.1.1 form属性 在H5之前,表
  • 阻止form表单提交

    千次阅读 2016-10-31 23:30:44
    今天写程序,发现一件很奇怪的事情,一个form表单框,里面只有一个text输入框,将鼠标放入到输入框内,敲击回车,表单就自动提交了,连个按钮都没有,很是费解,后来问了度娘才知道。浏览器在解析网页的时候,有许多...
  • antd快速开发(Form篇)

    千次阅读 2020-12-23 03:25:27
    前言由于一直在做中台业务,后台项目特别多,但是后台项目的特点是:大量的列表和大量表单,重复开发会降低效率,所以我这边总结了一下使用antd组件搭建form的快捷方法。希望能对大家有用。传统Form搭建首先传统搭建...
  • layui之form表单监听提交

    千次阅读 2021-07-01 17:59:07
    要想使用layui的form表单提交监听事件,需要给form标签增加禁止自动提交的属性onsubmit="return false; <form class="layui-form" action="" onsubmit="return false;"> <div class="layui-form-item">...
  • form表单防止重复提交的N种方法

    千次阅读 2019-04-29 17:17:50
    Form表单重复提交是在多用户Web应用中最常见、带来很多麻烦的一个问题。有很多的应用场景都会遇到重复提交问题,比如: (1)点击提交按钮两次。 (2)点击刷新按钮。 (3)使用浏览器后退按钮重复之前的操作,导致重复...
  • form表单改为AJAX提交

    千次阅读 2017-12-27 10:56:12
    一、form表单改成AJAX提交 ...form action="xxx" method="get"> //action的值是请求的url地址 div class="form-group"> label for="name">姓名label> input type="text" class="form-control" name="n
  • form表单可以提交,阻止页面跳转

    千次阅读 2018-07-25 20:21:01
    &lt;!DOCTYPE html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="UTF-8"&gt; &lt;title&gt;Document&...form actio
  • jsp表单中form标签的action属性的值

    万次阅读 2010-06-23 10:05:00
     jsp表单中form标签的action属性的值,也就是访问Action类中方法的路径(以下简称Path),大家都知道跟struts的配置文件中的path有关,在web.xml中有加载struts配置文件的代码,如下: <servlet> ...
  • 以下是图书管理系统,只有部分代码,主要实现从JSP传数据到action,分页显示没列出,详细在附件 1.add.jsp页面内容 String path = request.getContextPath(); String basePath = request.getScheme()+":/...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 85,131
精华内容 34,052
关键字:

给form增加action

友情链接: CMU3.rar