title: How to validate my MaterializeCSS form, and if first value in select selected - do not send form & display an error?
body: <p>I have done the following form with MaterializeCSS:</p>
  
  <pre><code>&lt;form action="num.php" method="GET" autocomplete="off"&gt;
  &lt;select id="num" name="num" class="browser-default"&gt;
  &lt;option selected="true" disabled selected&gt;Select number 
  &lt;/option&gt;
  &lt;option value="one"&gt;1&lt;/option&gt;
  &lt;option value="two"&gt;2&lt;/option&gt;
  &lt;option value="three"&gt;3&lt;/option&gt;
  &lt;/select&gt;
  &lt;button class="btn" type="submit"&gt;Show
  &lt;i class="material-icons right"&gt;send&lt;/i&gt;
  &lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The problem is that the user can click on the button,  without selecting a number. But I need that he first choose a value from the select, and only then press a button. And if he pressed a button without selecting a number (when "Select number:" selected), display an error and do not send the form. How can this be done with JavaScript?</p>