最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论

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

发布评论

评论列表(0)

  1. 暂无评论