Populate multiselect box using jquery?

Not very clear but I think after you are done appending the options to the select you need to refresh it like.

Not very clear but I think after you are done appending the options to the select you need to refresh it like $("#province"). Multiselect('refresh'); see here erichynds.com/examples/jquery-ui-multise... also instead of . RemoveAttr you can enable and disable the multi-select erichynds.com/examples/jquery-ui-multise... P.

S: you are selecting the dropdown by id and it goes like $("#province") NOT like $("province") have a look at jquery id selectors your complete code may look like - $(document). Ready(function(){ var $select = $("#province").multiselect();//apply the plugin $select. Multiselect('disable'); //disable it initially $.

Ajax({ type: "POST", url: "function. Aspx/provincelist", data: "", contentType: "application/json; charset=utf-8", dataType: "json", success: function OnPopulateControl(response) { list = response. D; if (list.

Length > 0) { $select. Multiselect('enable'); $("#province").empty(). Append('Please select'); $.

Each(list, function () { $("#province"). Append($(""). Val(this'Value').

Html(this'Text')); }); $("#province"). Val(valueselected); } else { $("#province").empty(). Append('Not available'); } $("#province").

Multiselect('refresh'); //refresh the select here }, error: function () { alert("Error"); } }); }).

It work with error : parent_20047 is null . I don't know about this. – Hainlp Aug 31 at 7:13 it works well.

Thanks very much :) – Hainlp Aug 31 at 7:22 you are welcome, glad that helped. – 3nigma Aug 31 at 7:24 But about 40 seconds appear an error : parent_2403 is null (document. Write('');) – Hainlp Aug 31 at 7:31 its difficult to tell from the error but some variable in your code seems to be undefined for example I don't see valueselected being initialized or assigned a value... – 3nigma Aug 31 at 7:43.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions