Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-31T06:18:56.370Z
Answers.LastActivityDate: 2017-03-31T10:55:46.633Z
Answers.LastEditDate: 2017-03-31T10:55:46.633Z
Answers.UserDisplayName: TomS
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-24T00:44:31.460Z
Comments.Text: 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.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-24T07:11:18.160Z
Comments.Text: 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.
Comments.UserDisplayName: TomS
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-24T08:22:25.413Z
Comments.Text: If you want to do that without making a request to the server, you'll need to use JavaScript to retrieve the selected value.
Comments.UserDisplayName: Stephen Lewis
Tags: <variable><frontend><drop-down><set>
Title: Reuse chosen dropdown field value on frontend
ThreadText: # 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') %}
  
  <select name="year">
  {% for entry in entries %}
    <option value={{ entry.year }}>{{ entry.year }}</option>
  {% 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') %}
  
  <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 entries = craft.entries.section('mountainbikes') %}
  
  {% set modelljahr = craft.request.getParam('modelljahr') %}
  
  <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') }}
  
  ```
  
  
  ---
  
  