zoukankan      html  css  js  c++  java
  • button点击按钮触发提交from表单数据

    1.html代码

    <form method="post" action="/xxx/" id="filter_all" >
        {% csrf_token %}
        <select name="filter_platform" id="filter_platform" style="height: 30px;border: 0; 250px;border-radius: 7px;background-color: #e2e2f5;">
            <option value="" style="display: none;" disabled selected>平台:{{ filter_platform }}</option>
            {% for server_host_type in server_host_type_list %}
                <option value="{{ server_host_type }}">{{ server_host_type }}</option>
            {% endfor %}
        </select>
        <select name="filter_accoount" id="filter_accoount" style="height: 30px;border: 0; 250px;border-radius: 7px;background-color: #e2e2f5;">
            <option value="" style="display: none;" disabled selected>账号:{{ filter_accoount }}</option>
            {% for account in accoount_list %}
                <option value="{{ account.platform }}_{{ account.account }}({{ account.name }})">{{ account.platform }}_{{ account.account }}({{ account.name }})</option>
            {% endfor %}
        </select>
        <select name="filter_project" id="filter_project" style="height: 30px;border: 0; 250px;border-radius: 7px;background-color: #e2e2f5;">
            <option value="" style="display: none;" disabled selected>项目:{{ filter_project }}</option>
            {% for project in project_list %}
                <option value="{{ project.id }}">{{ project.name }}</option>
            {% endfor %}
        </select>
        <button class="layui-btn layui-btn-small" style="height: 30px;line-height:1.6em;" title="筛选" onclick="submitForm_filter_platform()">
            <i class="layui-icon" style="line-height:32px;font-size: 14px;">筛选</i>
        </button>
    </form>

    2.javascript代码

    function submitForm_filter_platform(){
        //获取form表单对象,提交选择项目
        var form = document.getElementById("filter_all");
        form.submit();//form表单提交
    }
  • 相关阅读:
    linux 图形界面形式和命令行形式
    linux 配置 jdk7
    StackOverflowError
    一次失败的svchost hacking
    VB调用API的学习
    植物打僵尸休闲花园外挂代码
    中文日文翻译工具
    vb跨域访问,获得特定的frame进行处理
    HTML对象库简介(Microsoft HTML Object Library > mshtml.tlb)
    用正则分析一段vb代码含有哪些过程或者函数
  • 原文地址:https://www.cnblogs.com/chenjw-note/p/12703596.html
Copyright © 2011-2022 走看看