Answers.Body: <p>Issue was not related to the above code but more due to other loops in template. thanks for comments.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-05T14:45:33.967Z
Answers.LastActivityDate: 2017-06-05T14:45:33.967Z
Answers.UserDisplayName: user6798
Body: <p>I have a multi-select field that I need to test for any 'selected values'...the below always has a return even when no values are selected. How do I check this multi-select to ensure there are selected values to output?</p>
  
  <p>Thanks in advance.</p>
  
  <pre><code>{% if entry.myMultiSelect|length %}
      &lt;!-- Output HTML + option values --&gt;
      {% for option in entry.myMultiSelect%}
          {{ option }}
      {% endfor %}
  {% else %}
      &lt;!--Do something else --&gt;               
  {% endif %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-01T21:45:56.607Z
Comments.Text: You on the latest version of Craft?  I just did a test using your exact code and it works exactly as you'd expect. Outputs the options if there were selections and skips it if there were none.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-02T22:54:19.097Z
Comments.Text: Hmm, so now that I think about it and re-look @ my code, think it is working correctly but my loops (and there are many) are not in the correct HTML blocks....thanks for your response.
Comments.UserDisplayName: user6798
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-06-03T00:19:02.400Z
Comments.Text: When you get to the bottom of it, would you mind adding your solutions as an official answer?
Comments.UserDisplayName: Brad Bell
Tags: <templating>
Title: Multi-Select Tests
ThreadText: # Multi-Select Tests
  
  (Asked by: username_0 on 2017-06-01)
  
  I have a multi-select field that I need to test for any 'selected values'...the below always has a return even when no values are selected. How do I check this multi-select to ensure there are selected values to output?
  
  Thanks in advance.
  
  ```
  {% if entry.myMultiSelect|length %}
      <!-- Output HTML + option values -->
      {% for option in entry.myMultiSelect%}
          {{ option }}
      {% endfor %}
  {% else %}
      <!--Do something else -->               
  {% endif %}
  
  ```
  
  **Tags:** templating
  
  > **Comments:**
  > **username_1**: You on the latest version of Craft?  I just did a test using your exact code and it works exactly as you'd expect. Outputs the options if there were selections and skips it if there were none.  
  > **username_0**: Hmm, so now that I think about it and re-look @ my code, think it is working correctly but my loops (and there are many) are not in the correct HTML blocks....thanks for your response.  
  > **username_1**: When you get to the bottom of it, would you mind adding your solutions as an official answer?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-06-05. Score: 1
  
  Issue was not related to the above code but more due to other loops in template. thanks for comments.
  
  
  ---
  
  