0

I'd would like to use the jquery validation plugin to validate and ensure that the user selects an option. I know that it's working if you leave the first option value blank like this :

<select id="jungle" name="jungle" title="Please select something!" validate="required:true">
        <option value=""></option>
        <option value="1">Buga</option>
        <option value="2">Baga</option>
        <option value="3">Oi</option>
    </select>

But I need a solution where I can have the value of the first option not blank as it needs to be filled dynamically. e.g.

<select id="jungle" name="jungle" title="Please select something!" validate="required:true">
    <option value="default"></option>
    <option value="1">Buga</option>
    <option value="2">Baga</option>
    <option value="3">Oi</option>
</select>

Does anybody knows how to customize the default validation to have this working ?

  • Check this out http://stackoverflow.com/questions/2901125/jquery-validate-required-select – Bishnu Paudel Jul 03 '12 at 23:09
  • Hi. Thanks. I tried that before but it doesn't work for me...Any other solutions ? – user1500041 Jul 04 '12 at 12:11
  • Ok. So for everyone who had problems like me with this solution: http://stackoverflow.com/questions/2901125/jquery-validate-required-select...you need to put the jquery code snippet somewhere inside the form tags otherwise it won't work...at least for me it didn't worked. Maybe it's obvious..it wasn't for me though ;) – user1500041 Jul 04 '12 at 14:01

0 Answers0