表格不提交任何参数

时间:2013-08-20 07:00:33

标签: javascript html

表格不提交任何参数。我该如何解决?

<form action="{{ path('search') }}" method="POST">

<div class="block-17">
<div class="block-17_1">
    Каталог автомобилей
</div>
<div class="block-17_2">
    <div class="block-17_2_1">
        <span>Поиск автомобилей</span>
        <a href="">Сравнить автомобили</a>
    </div>
    <div class="block-17_2_2">
        <div>
            <span class="block-17_2-name">Марка</span>
            <div class="block-17_select-v1">
                <select>
                    <option value="">Любая</option>
                    {% for manufacturer in manufacturers %}
                        <option value="{{ manufacturer.manufacturer }}">{{ manufacturer.manufacturer }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
        <div>
            <span class="block-17_2-name">Модель</span>
            <div class="block-17_select-v1">
                <select style="width: 100px">
                    <option value="">Любая</option>
                </select>
            </div>
        </div>
        <div>
            <span class="block-17_2-name">Цена (руб.)</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for value in [500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 15000, 20000, 25000, 50000, 100000, 200000] %}
                            <option value="{{ value }}">{{ value }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="block-17_2-tire">
                    -
                </div>
                <div class="block-17_select-v2">
                    <select  >
                        {% for value in [500, 1000, 2000, 3000, 4000, 5000, 6000, 7000, 8000, 9000, 10000, 15000, 20000, 25000, 50000, 100000, 200000] %}
                            <option value="{{ value }}">{{ value }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="clearboth">
                </div>
            </div>
        </div>
        <div class="clearboth">
        </div>
    </div>
    <div class="clearboth">
    </div>
</div>

<div class="block-17_3" id="block-17_3" style="overflow: hidden;">
    <div class="block-17-hide">

        <div class="block-17_3_1">
            <span class="block-17_2-name">Объем двигателя (л.)</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for value in [0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7] %}
                            <option value="{{ value }}">{{ value }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="block-17_2-tire">-</div>
                <div class="block-17_select-v2">
                    <select>
                        {% for value in [0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 5, 6, 7] %}
                            <option value="{{ value }}">{{ value }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="clearboth">
                </div>
            </div>
        </div>
        <div class="block-17_3_1">
            <span class="block-17_2-name">Мощность двигателя (л. с.)</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for value in [50, 100, 150, 200, 250, 300, 400, 500, 600, 700] %}
                            <option value="{{ value }}">{{ value }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="block-17_2-tire">-</div>
                <div class="block-17_select-v2">
                    <select>
                        {% for value in [50, 100, 150, 200, 250, 300, 400, 500, 600, 700] %}
                            <option value="{{ value }}">{{ value }}</option>
                        {% endfor %}
                    </select>
                </div>
                <div class="clearboth">
                </div>
            </div>
        </div>

        <div class="block-17_3_1">
            <span class="block-17_2-name">Коробка передач</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for transmission in transmissions %}
                            <option value="{{ transmission.transmission }}">{{ transmission.transmission }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="block-17_3_1">
            <span class="block-17_2-name">Тип двигателя</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for engineType in engineTypes %}
                            <option value="{{ engineType.type }}">{{ engineType.type }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="clearboth clearboth-block-17_3">
        </div>

        <div class="block-17_3_1">
            <span class="block-17_2-name">Тип кузова</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for body in bodies %}
                            <option value="{{ body.body }}">{{ body.body }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="block-17_3_1">
            <span class="block-17_2-name">Привод</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for transferCase in transferCases %}
                            <option value="{{ transferCase.transferCase }}">{{ transferCase.transferCase }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="block-17_3_1" style="width: 145px">
            <span class="block-17_2-name">Опции</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select style="width: 145px">
                        {% for option in options %}
                            <option value="{{ option.equipment }}">{{ option.equipment }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="block-17_3_1" >
            <span class="block-17_2-name">Страна принадлежности</span>
            <div class="block-17_select-v2_outer">
                <div class="block-17_select-v2">
                    <select>
                        {% for transferCase in transferCases %}
                            <option value="{{ transferCase.transferCase }}">{{ transferCase.transferCase }}</option>
                        {% endfor %}
                    </select>
                </div>
            </div>
        </div>

        <div class="clearboth">
        </div>

        <div></div>

        <div class="block-17_hide_button_open">
            <a onclick="openboxhidden('block-17_3'); return false" href="#">Скрыть дополнительные параметры</a>
        </div>

    </div>
</div>

<div class="clearboth">
</div>

<div class="block-17_4">
    <input type="submit" value="Поиск" name="" />
    <a onclick="openboxhidden('block-17_3'); return false" href="#">Показать дополнительные параметры</a>
</div>

</div>

</form>

3 个答案:

答案 0 :(得分:5)

向表单控件(name等)

添加<select>属性

答案 1 :(得分:1)

您的name字段中没有select属性。 为了提交,应该像这样构建一个select元素(或输入):

    <select name="my_select">
    {% for transferCase in transferCases %}
        <option value="{{ transferCase.transferCase }}">{{ transferCase.transferCase }}</option>
    {% endfor %}
    </select>

    <input name="my_search" value="">

答案 2 :(得分:1)

添加名称字段以选择框。

例如:

<select name="some_name">

</select>

Then access in it server using
echo $_POST["some_name"];