How can i use jquery validation framework on a select tag -


how can use jquery validation framework on select tab

this fiddle

http://jsfiddle.net/2yxsl/377/

i have tried

<select  id="bsnesstype" name="bsnesstype" class="span12 valid"> <option value="select">select</option> <option value="101">theatre</option> <option value="102">restaurant</option> </select>    $('#mailer').validate({     focusinvalid: false,     debug: true,     rules: {         name: {             required: true         },         email_address: {             required: true,         },         bsnesstype: {             required: true,         }      },     messages: {         name: {             required: 'name required'         },         email_address: {             required: 'email required',             email: 'email address not valid'         },          bsnesstype: {             required: 'bsnesstype required',          }      },       submithandler: function(event, validator) {       if ($("#mailer").valid()) {         callformsubmit();         return false;       }     }  }); 

please let me know how ??

set empty value option select. here fiddle updated.. empty value means nothing there , trigger required validation.

<option value="">select</option> 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -