Answers.Body: <p>If you've got a dropdown field defined with no value as one of the options, it should be as simple as:</p>
  
  <pre><code>{% if entry.dropdownFieldHandle %}
      {{ entry.dropdownFieldHandle }}
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-10T17:44:28.233Z
Answers.Text: Thanks Brad.  I'm going to mark this as the correct answer because it does work.  However, it is showing content inside the {% if %} statement even if a value has been selected from the dropdown, which is strange.  No worries though, I am modifying my template to avoid that.
Answers.UserDisplayName: Todd
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-10T06:32:12.943Z
Answers.LastActivityDate: 2017-03-10T06:32:12.943Z
Answers.UserDisplayName: Brad Bell
Body: <p>I've set up a dropdown field for the client to choose from a list of pre-defined addresses.  In my template, I want to determine whether the field has a value or not.  When I look in the database, Entry A has a value of 'NULL', while Entry B has a value of 'address1'.  So the field is working properly in those regards.</p>
  
  <p>However, in my template it's all or nothing.  Here is my code:</p>
  
  <pre><code>{% if event.includeMap|length %}
  &lt;tr&gt;
      &lt;th class="small"&gt;
          Defined? {{ event.includeMap is defined }}&lt;br&gt;
          Not Null? {{ event.includeMap is not null }}&lt;br&gt;
          Null: {{ event.includeMap is null }}&lt;br&gt;
          Value: {{ event.includeMap }}
      &lt;/th&gt;
      &lt;td align="center"&gt;
          {% include 'partials/_inc-map' %}
      &lt;/td&gt;
  &lt;/tr&gt;
  {% endif %}
  </code></pre>
  
  <p>I've added the options in the left column to see what the database returns.  In both cases, they return the same values.  However, with Entry A, nothing is returned as a value, and in Entry B, the correct value appears.</p>
  
  <p>I have also tried </p>
  
  <pre><code>{% if event.includeMap is defined %}
  {% if event.includeMap is not null %}
  </code></pre>
  
  <p>Any other thoughts?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-10T01:09:09.330Z
Comments.Text: How does your dropdown not have anything selected?  Do you have an empty label/value at the top or something and you consider that nothing selected?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-10T05:04:33.637Z
Comments.Text: I have the first option as a "Please Select...." with nothing as a value (which someone recommended in another post).  Am I better off adding a value of 0 or something and testing against that?
Comments.UserDisplayName: Todd
Tags: <templating>
Title: Testing for Dropdown Value
ThreadText: # Testing for Dropdown Value
  
  (Asked by: username_0 on 2017-03-09)
  
  I've set up a dropdown field for the client to choose from a list of pre-defined addresses. In my template, I want to determine whether the field has a value or not. When I look in the database, Entry A has a value of 'NULL', while Entry B has a value of 'address1'. So the field is working properly in those regards.
  
  However, in my template it's all or nothing. Here is my code:
  
  ```
  {% if event.includeMap|length %}
  <tr>
      <th class="small">
          Defined? {{ event.includeMap is defined }}<br>
          Not Null? {{ event.includeMap is not null }}<br>
          Null: {{ event.includeMap is null }}<br>
          Value: {{ event.includeMap }}
      </th>
      <td align="center">
          {% include 'partials/_inc-map' %}
      </td>
  </tr>
  {% endif %}
  
  ```
  
  I've added the options in the left column to see what the database returns. In both cases, they return the same values. However, with Entry A, nothing is returned as a value, and in Entry B, the correct value appears.
  
  I have also tried
  
  ```
  {% if event.includeMap is defined %}
  {% if event.includeMap is not null %}
  
  ```
  
  Any other thoughts?
  
  **Tags:** templating
  
  > **Comments:**
  > **username_1**: How does your dropdown not have anything selected?  Do you have an empty label/value at the top or something and you consider that nothing selected?  
  > **username_0**: I have the first option as a "Please Select...." with nothing as a value (which someone recommended in another post).  Am I better off adding a value of 0 or something and testing against that?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-03-10. Score: 4 | Accepted answer
  
  If you've got a dropdown field defined with no value as one of the options, it should be as simple as:
  
  ```
  {% if entry.dropdownFieldHandle %}
      {{ entry.dropdownFieldHandle }}
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks username_1.  I'm going to mark this as the correct answer because it does work.  However, it is showing content inside the {% if %} statement even if a value has been selected from the dropdown, which is strange.  No worries though, I am modifying my template to avoid that.  
  
  ---
  
  