[RESOLVED] moving items from a listbox to another listbox.
Hi All,
In my View I have the following:
Code:
<td>@Html.ListBox("Available", new MultiSelectList(Model.AvailableFloatingZones, "PolicyZoneID", "FullAddress"))</td>
<td><input type="submit" name="add" id="add" value=">>" /><br /><input type="submit" name="remove" id="remove" value="<<" /></td>
<td>@Html.ListBox("UnAvailable", new MultiSelectList(Model.AllocatedFloatingZones, "PolicyZoneID", "FullAddress"))</td>
on initial view both listboxes display my data correctly. My problem is moving the values between the 2.
In my JQuery for the buttons I have code in the form:
Code:
$("#add").click(function (e) {
$('#Available > option:selected').appendTo('#Unavailable');
e.preventDefault();
});
when I click the buttons they do go into the click event, but the appendTo does not work.
Can anybody make any suggestions. thanks
Re: moving items from a listbox to another listbox.
on my appendTo Unavailable should have been UnAvailable and the input type of my buttons needed to be button as opposed to submit