0

I'm using the jQuery dropdown that was developed by Eric Hynds. Eric Hynds Multi-select

I want to have a multi-select dropdown and a single select dropdown on the page. I thought I could reference it this way:

 $(function () {

  $("select").multiselect({
    selectedList: 4
  });

  $("#ddlYear").multiselect({
    multiple: false,
    selectedList: 1
  });
});


 <div class="multiselectlist">
     <select id="msStatus" multiple="true" runat="server"/>
 </div>

 <div><select id="ddlYear" multiple="false" runat="server"/></div>

I populate the dropdowns from code-behind getting data from the database. Even though I set the single select (ddlYear) to not be multiple it still shows up as a multi-select dropdown.

Is there a way for the two type of dropdowns to exist on the same page? Thanks.

4

2 回答 2

0

尝试这个,

$("#msStatus").multiselect({
    selectedList: 4
  });

  $("#ddlYear").multiselect({
    multiple: false,
    selectedList: 1
  });
于 2012-05-08T03:55:31.157 回答
0

您可以坚持使用该插件,也可以使用这两个插件中的任何一个

jQuery 插件 1

jQuery插件2

您的脚本似乎有错误

于 2012-05-08T06:29:57.043 回答