html - How to add checkall and uncheck all option for jquery multiselect? -
I have added jquery multiselect property to my dropdown. I dropdown is such,
& lt; Div & gt; & Lt; Id = "selectChartType" multi = "multiple" size = "5" style = "width: 25px" & gt; & Lt; Option value = "option1" & gt; Option 1 & lt; / Options & gt; & Lt; Option value = "option 2" & gt; Option 2 & lt; / Options & gt; & Lt; Option value = "option3" & gt; Option 3 & lt; / Options & gt; & Lt; Option value = "option4" & gt; Option 4 & lt; / Options & gt; & Lt; Option value = "option5" & gt; Option 5 & lt; / Options & gt; & Lt; Option value = "option 6" & gt; Option 6 & lt; / Options & gt; & Lt; Option value = "option 7" & gt; Option 7 & lt; / Options & gt; & Lt; Option value = "option8" & gt; Option 8 & lt; / Options & gt; & Lt; Option value = "option 9" & gt; Option 9 & lt; / Options & gt; & Lt; Option value = "option 10" & gt; Option 10 & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt; I'm starting multiselect like this,
$ (document) .ready (function () {$ ("# selectchartType"). Multiselect ({Header: false, none selected selected: "options", minwaveth: 190});}); I'm calling 2 options dropdown and unchecklow. I know that there is an option,
$ ("# selectchartType"). Multiselect ({CheckAll}); But I do not know how to add it to html.
Please
You should use something like this for jquery < / P>
JQuery $ (document) .ready (function () {$ ("# checkAll") click (function () {$ ('# SelectedChartType option'). ('Selected', true);}); $ ("# uncheck") Click (function () {$ ('# selectChartType Options') .prop ('selected', incorrect );});}); and HTML as & lt; Div & gt; Add buttons in & Lt; Id = "selectChartType" multi = "multiple" size = "5" style = "width: 250px" & gt; & Lt; Option value = "option1" & gt; Option 1 & lt; / Options & gt; & Lt; Option value = "option 2" & gt; Option 2 & lt; / Options & gt; & Lt; Option value = "option3" & gt; Option 3 & lt; / Options & gt; & Lt; Option value = "option4" & gt; Option 4 & lt; / Options & gt; & Lt; Option value = "option5" & gt; Option 5 & lt; / Options & gt; & Lt; Option value = "option 6" & gt; Option 6 & lt; / Options & gt; & Lt; Option value = "option 7" & gt; Option 7 & lt; / Options & gt; & Lt; Option value = "option 8" & gt; Option 8 & lt; / Options & gt; & Lt; Option value = "option 9" & gt; Option 9 & lt; / Options & gt; & Lt; Option value = "option 10" & gt; Option 10 & lt; / Options & gt; & Lt; / Select & gt; & Lt; / Div & gt; & Lt; Input type = "button" id = "check all" value = "check all" & gt; & Lt; Input type = "button" id = "unCheckAll" value = "un-check all" & gt; You can see here.
And I think that you are using a multi-select plugin, you can check your doctor or tell us which plugin you are using to help you with it Are there.
Comments
Post a Comment