Results 1 to 2 of 2

Thread: [RESOLVED] moving items from a listbox to another listbox.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    Resolved [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

  2. #2

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Dunmow,Essex,England
    Posts
    898

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width