javascript - selecting checkboxes in jQuery UI MultiSelect Widget - Stack Overflow

I'm using jQuery UI MultiSelect WidgetI'm using 5 of them in one page What I'm looking

I'm using jQuery UI MultiSelect Widget I'm using 5 of them in one page What I'm looking for is to programmatically select couple of of check boxes in each of the MultiSelect widget I found the following code after a fair amount of research

$("select").multiselect("widget").find(":checkbox[value='value']").each(function() {
    this.click();
});

this one works but only works for the first widget How could I do this for the other widgets as well Looking forward to some replies that would help me to progress

thanks in advance

I'm using jQuery UI MultiSelect Widget I'm using 5 of them in one page What I'm looking for is to programmatically select couple of of check boxes in each of the MultiSelect widget I found the following code after a fair amount of research

$("select").multiselect("widget").find(":checkbox[value='value']").each(function() {
    this.click();
});

this one works but only works for the first widget How could I do this for the other widgets as well Looking forward to some replies that would help me to progress

thanks in advance

Share Improve this question asked Mar 17, 2014 at 18:02 Gotham's ReckoningGotham's Reckoning 1294 silver badges19 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2

I found the answer myself I would like to close it but the solution was quite simple

changing Select to the id of the select will give the user the ability to get any particular multiselct widget.Like the snippet below

$("#idOfSelect").multiselect("widget").find(":checkbox[value='bing']").each(function()          {
    this.click();
});

There is no native method called .multiselect in jQuery. This is a custom method created by the widget author.

I'm assuming this is your widget, with some basic how-to's: jQuery UI Multiselect

Linked from that page is a demo page showing multiple groups of select options. The author explains how to bind the events/methods to the groups. Look there first and then e back if you have problems.

jQuery UI Multiselect Demo Page

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745459589a4628644.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信