Hello,
I am using the following Multiple Select JQuery plugin with ASP.NET
MVC.
http://abeautifulsite.net/notebook/62
When the form is posted back the values selected before are unselected
now ...
I have an idea of how to solve this but I don't know how to implement
it in JQuery.
The plugin is aplied as follows:
$("select.Multi").multiSelect();
And I get something like:
<input type="checkbox" value="1" name="Roles"/>
<input type="checkbox" value="2" name="Roles"/>
1) I need to find the IDs of all the "select.Multi" on the page before
multiSelect() is applied;
2) After multiSelect() is applied I need to:
a) Find all hidden inputs which ID is equal to IDs found in (1)
plus Data.
For example if in (1) I found the IDs "Roles" and "Levels"
now I would find:
"RolesData" and "LevelsData"
b) RolesData and LevelsData contain the selected values before
posted back:
Example: RolesData contains "1, 4, 7, 11"
c) I need to find all checkbox inputs which name is "Roles" and
make the ones with value "1, 4, 7, 11" checked.
I think this is the way to solve this problem.
But I have no idea how to do this in JQuery.
Could someone please, help me out?
Thank You,
Miguel