I made dropdown using chosen plugin and want to validate uisng jquery validate_init.js plugin but i cant validate
I give both rules and messages in validate.js file but cant work for me,find my code below
<select class="chzn-select form-control input-crtl input-drp" id="cus_record" name="customer_name" placeholder="Select Customer" width="391px">
<option value="0">Select Customer</option>
<?php foreach($customers_records as $key=>$value) { ?>
<option <?php if(set_value('customer_name',$this->form_data->customer_id) == $value->id) { echo "selected";} ?> value="<?php echo $value->id; ?>"><?php echo $value->first_name." ".$value->last_name."(".$value->email.")"; ?></option>
<?php } ?>
</select>
$("#advertisement_form1").validate({
rules: {
customer_name: {
required: true,
}
}
customer_name: {
required: 'Customer name field is required.',
},
})