Using Jquery to add items in Listbox from Textbox

Posted by Pratik Gupta on Stack Overflow See other posts from Stack Overflow or by Pratik Gupta
Published on 2012-07-06T08:43:16Z Indexed on 2012/07/06 9:15 UTC
Read the original article Hit count: 230

Filed under:
|
|
|
|

I am stuck somewhere using jquery to append the list box from a text box.

here is my jquery

  $("#btnAddSvc").click(function () {
        var svc = $("#<%= txtServiceName.ClientID %>").val();  //Its Let you know the textbox's value   
        svc.appendTo("#<%=lstSvcName.ClientID %>");
    }); 

I am using asp.net (c#) to develop my code

<asp:Button ID="btnAddSvc" runat="server" Text=">>" Font-Size="Medium" />
<asp:ListBox ID="lstSvcName" runat="server" SelectionMode="Multiple" ToolTip="Selected Service Names"
                Width="169px"></asp:ListBox>

can someone please help as i am not able to get the values in list box.

© Stack Overflow or respective owner

Related posts about c#

Related posts about JavaScript