How to set multiple selected value in Chosen Jquery Plugin?

How to set multiple selected value in Chosen Jquery Plugin?

In this post we will give you information about How to set multiple selected value in Chosen Jquery Plugin?. Hear we will give you detail about How to set multiple selected value in Chosen Jquery Plugin?And how to use it also give you demo for it if it is necessary.

If you require to set selected value in Chosen Jquery Plugin then you can done using val() with trigger(). Some days ago, i had worked my php project i needed to set selected value wiht chosen and also multiple selected value both. After some try i found how to do with if set single selected value using val().

But i was confuse with dropdown multiple selected value, but at last i found how to give value, we have to just pass array in val(). As bellow i mention both way how could done.

Set Single Value:

var my_val = 3;


$("#set-corsi").val(my_val).trigger("chosen:updated");

Set Multiple Value:

var my_val = 3,4,6;

var str_array = my_val.split(',');


$("#set-corsi").val(str_array).trigger("chosen:updated");

Hope this code and post will helped you for implement How to set multiple selected value in Chosen Jquery Plugin?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

12  +    =  13

We accept paid advance and paid guest Posting on our Site : Contact US