title: JavaScript - Validate dropdown using Vue.js
body: <p>I need to validate a dropdown using Vue.Js. This is the dropdown</p>
  
  <pre><code>&lt;select name="notificationPreference" id="notificationPreference" v-model="notificationPreference"&gt;
      &lt;option value hidden&gt;&lt;/option&gt;
      &lt;option value="1"&gt;Email&lt;/option&gt;
      &lt;option value="2"&gt;Text Message&lt;/option&gt;
      &lt;option value="3"&gt;Email and Text&lt;/option&gt;
  &lt;/select&gt; &lt;/td&gt; &lt;/tr&gt;
  </code></pre>
  
  <p>I can already do this using just Javascript, like so</p>
  
  <pre><code>var e = document.getElementById("notificationPreference");
  var strUser = e.options[e.selectedIndex].value;
  
  if(strUser==0)
  {
      alert("Please select a service");
      e.preventDefault();
      return false;
  }
  </code></pre>
  
  <p>However, I don't know how to do this with Vue.js...</p>