<p>i've got now a working approach to my question above:</p>

<pre><code>{% set field = craft.fields.getFieldByHandle('jahrgang') %}

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

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

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

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

{{ craft.request.getParam('modell') }}
</code></pre>

CC BY-SA 3.0
2017-03-31T06:18:56.370Z
2017-03-31T10:55:46.633Z
2017-03-31T10:55:46.633Z
TomS
<p>I would like to choose entry values from a frontend dropdown and reuse the chosen value directly.</p>

<pre><code>{% set entries = craft.entries.section('mountainbikes') %}

&lt;select name="year"&gt;
{% for entry in entries %}
  &lt;option value={{ entry.year }}&gt;{{ entry.year }}&lt;/option&gt;
{% endfor %}          
</code></pre>

<p></p>

<p>How can i get the chosen value and reuse it in the same template?
For example:</p>

<pre><code>{% for entry in entries %}
  {% if entry.year == '2015' %} /* chosen value in dropdown field */
    {{ entry.title }}
  {% endif %}
{% endfor %}
</code></pre>

<p>Thanks for any help!</p>

CC BY-SA 3.0
2017-02-24T00:44:31.460Z
Just to clarify, you want to use the chosen value elsewhere in the template on the same request? i.e. without hitting a submit button somewhere and using it on another page.
Brad Bell
CC BY-SA 3.0
2017-02-24T07:11:18.160Z
Actually, yes - on the same request. I would like to build a little suspension setup calculator, where i'd like to choose the bike first by year and second by modell (Both are field entries). Then put out the appropriate setup values.
TomS
CC BY-SA 3.0
2017-02-24T08:22:25.413Z
If you want to do that without making a request to the server, you'll need to use JavaScript to retrieve the selected value.
Stephen Lewis
<variable><frontend><drop-down><set>
Reuse chosen dropdown field value on frontend
# Reuse chosen dropdown field value on frontend

(Asked by: username_0 on 2017-02-23)

I would like to choose entry values from a frontend dropdown and reuse the chosen value directly.
{% set entries = craft.entries.section('mountainbikes') %}


{% for entry in entries %}
  {{ entry.year }}
{% endfor %}          


How can i get the chosen value and reuse it in the same template?
For example:
{% for entry in entries %}
  {% if entry.year == '2015' %} /* chosen value in dropdown field */
    {{ entry.title }}
  {% endif %}
{% endfor %}

Thanks for any help!

**Tags:** variable, frontend, drop-down, set

> **Comments:**
> **username_1**: Just to clarify, you want to use the chosen value elsewhere in the template on the same request? i.e. without hitting a submit button somewhere and using it on another page.  
> **username_0**: Actually, yes - on the same request. I would like to build a little suspension setup calculator, where i'd like to choose the bike first by year and second by modell (Both are field entries). Then put out the appropriate setup values.  
> **username_2**: If you want to do that without making a request to the server, you'll need to use JavaScript to retrieve the selected value.  

---

## 1 answers

### Answer by username_0 on 2017-03-31. Score: 1 | Accepted answer

i've got now a working approach to my question above:
{% set field = craft.fields.getFieldByHandle('jahrgang') %}


   
     {% for opt in field.settings.options %}
        {{ opt.value }}
     {% endfor %}
   

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

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


  
    {% for entry in entries %}
      {% if entry.jahrgang == modelljahr %}
        {{ entry.title }}
      {% endif %}
    {% endfor %}
  

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


---

