1

This works for me, but i would like to solve this with ajax without reloading the page. Choosing the values from the Dropdowns and submit the data per POST Method, so i can return the value with "getParam( name )". This question is related to my own question Reuse chosen dropdown field value on frontend

{% set field = craft.fields.getFieldByHandle('jahrgang') %}

<form action="tourdefrance.html" method="post">
   <select class="dropdown" name="modelljahr" size="1" onchange="this.form.submit();">
     {% for opt in field.settings.options %}
        <option name="fields[myFieldHandle][]" value="{{ opt.value }}">{{ opt.value }}</option>
     {% endfor %}
   </select>

{% set modelljahr = craft.request.getParam('modelljahr') %}
{% set entries = craft.entries.section('mountainbikes') %}

<form action="tourdefrance.html" method="post">
  <select class="dropdown" name="modell" size="1" onchange="this.form.submit();">
    {% for entry in entries %}
      {% if entry.jahrgang == modelljahr %}
        <option value="{{ entry.title }}">{{ entry.title }}</option>
      {% endif %}
    {% endfor %}
  </select>

{{ craft.request.getParam('modell') }}

Thanks a lot!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.