0

フォームはパラメーターを送信しません。どうすれば修正できますか?

<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>
4

3 に答える 3

1

フィールドnameに属性がありません。select送信するには、選択要素 (または入力) を次のように作成する必要があります。

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

    <input name="my_search" value="">
于 2013-08-20T07:04:51.130 に答える
1

ボックスを選択するための名前フィールドを追加します。

例えば:

<select name="some_name">

</select>

Then access in it server using
echo $_POST["some_name"];
于 2013-08-20T07:05:52.660 に答える