title: How to do form validation for a select box?
body: <p>I am trying to provide an error message when users do not pick a value on the select box. The VMware Clarity documentation is pretty clear when we are dealing with <code>&lt;input type="text"&gt;</code> elements (<a href="https://vmware.github.io/clarity/documentation/input-fields" rel="nofollow noreferrer">click here</a>), which says:</p>
  
  <blockquote>
    <p>You can use validation styling for input fields by wrapping the input
    tag in a container with the .tooltip class along with the
    .tooltip-validation class. Use the .invalid class on the
    .tooltip-validation container to toggle the validation styling. Place
    the .tooltip-content after the input tag.</p>
  </blockquote>
  
  <p>There is no documentation explaining how we should do validation with select boxes (<a href="https://vmware.github.io/clarity/documentation/select-boxes" rel="nofollow noreferrer">click here</a>). </p>
  
  <p>So, I tried the following:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;label for="technology"&gt;Technology&lt;/label&gt;
      &lt;div class="select tooltip tooltip-validation tooltip-sm invalid"&gt;
          &lt;select formControlName="technology"&gt;
              &lt;option value=""
                  disabled&gt;- Select an API Technology -&lt;/option&gt;
              &lt;option *ngFor="let technology of technologies"
                  [value]="technology"&gt;{{technology}}&lt;/option&gt;
          &lt;/select&gt;
          &lt;span class="tooltip-content"&gt;
              Technology is required.
          &lt;/span&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the result that I am getting:</p>
  
  <p><a href="https://i.stack.imgur.com/1wNjR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1wNjR.png" alt="enter image description here"></a></p>
  
  <p>Notice that the tooltip icon is there, but when the user clicks, it does not show the desired content "Technology is required"</p>
  
  <p><strong>My question is: What is the best practice to do validation with select boxes?</strong></p>