How to validate multiple selectbox in jquery on basis of ID ?

<select size=”4″ multiple=”multiple” id=”global_promotion_ids” name=”global_promotion_ids[]” class=”col-xs-12 col-sm-7″>
<option value=””>Please Select</option>
<option value=”1″>Option 1</option>
<option value=”2″>Option 2</option>
</select>

admin Administrator Asked on August 7, 2015 in Education.
Add Comment
2 Answers

Add below line after jquery.validate

$( “#global_promotion_ids” ).rules( “add”, {
required: true,
minlength: 1,
messages: {
required: “Please select promotion”,
minlength: jQuery.validator.format(“Please, at least {0} characters are necessary”)
}
});

admin Administrator Answered on August 7, 2015.
Add Comment

Add below line after jquery.validate

$( “#global_promotion_ids” ).rules( “add”, {
required: true,
minlength: 1,
messages: {
required: “Please select promotion”,
minlength: jQuery.validator.format(“Please, at least {0} characters are necessary”)
}
});

admin Administrator Answered on October 13, 2015.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.