title: jquery listbox validation
body: <p>I'm using Jquery and html and I just ran into an issue with list menu (multiple) validation. The issue is that I cannot(/do not know how to) count the number of selections the user has made. I tried adding ':' at the end of every option value and then split the text into an array, and it did work but then I mess my database. </p>
  
  <pre><code>  var int_country= $('#int_country :selected').text();
    listLength = int_country.split(":");
  
  if (listLength.length &gt; 16){
  
  var i = listLength.length -1;
  alert ("You have selected " + i + " countries. \nPlease select 15 or less international countries!");
      $('#int_country').focus();
      return false;
  }               
  </code></pre>
  
  <p>Any suggestions how to get around this?</p>