title: Get MultiChosen select value on form submit using JQUERY
body: <p>I am using Chosen Jquery Plugin for populating my select boxes.</p>
  
  <p>I am trying to submit form using jquery and I have to <strong>check the select box whether it has value or not .</strong></p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form class="addData" action="getData.php" method="post"&gt;
      &lt;div class="form-group"&gt;
          &lt;select data-placeholder="Choose a manager.." name="user[]" class="form-control chosen-select" id="user" multiple&gt;
           &lt;option value="7"&gt;User1&lt;/option&gt;
           &lt;option value="8"&gt;User2&lt;/option&gt;
           &lt;option value="9"&gt;User3&lt;/option&gt;
           &lt;option value="10"&gt;User4&lt;/option&gt;
           &lt;option value="11"&gt;User5&lt;/option&gt;
           &lt;option value="12"&gt;User6&lt;/option&gt;
           &lt;option value="13"&gt;User7&lt;/option&gt;
        &lt;/select&gt;
      &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>JQUERY CODE</strong></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function() {
           $('#user').chosen({
              width:'100%' ;
           });
           $('.addData').submit(function(){
              var select_val = $('#user').val();
              // var select_val = $('#user').chosen().val();
              if(select_val == "") {
                  alert("No data select");
              } else {
                  alert("Form is ready to submit");
              }
              return false;
           });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>If I have not selected a value <code>console.log(select_val)</code> return <code>null</code> and 
  If I have selected a value <code>console.log(select_val)</code> return <code>Array [ "8", "9" ]</code> But When i validate it and check like </p>
  
  <p><code>if(select_val == "" || select_val == NULL)</code> it gives me error <strong>ReferenceError: NULL is not defined</strong></p>
  
  <p><code>if(select_val.length == 0)</code> it gives me error <strong>TypeError: select_val is null</strong></p>
  
  <p>Please Help me how to validate this variable</p>