Getting array of Values of Textboxes with the same class

Posted by nCdy on Stack Overflow See other posts from Stack Overflow or by nCdy
Published on 2010-04-16T06:28:57Z Indexed on 2010/04/16 6:33 UTC
Read the original article Hit count: 153

Filed under:
|
|

I setup custom CSS class for array of dynamic TextBoxes (inputs as HTML)

so... now I need to get array of it :

<input type="text" style="width: 50px;" class="DynamicTB" id="ctl00_ContentPlaceHolder1_GridView1_ctl02_id" readonly="readonly" value="1" name="ctl00$ContentPlaceHolder1$GridView1$ctl02$id">

sure client don't really knows the count of inputs. That's why I use class and here is what I'm trying to make :

        $.each( { id : $("input.DynamicTB").css("value") }, 
        function(id){
            CallPageMethod("SelectBook", success, fail, "id",id);
        });

I'm not sure if this $("input.DynamicTB").css("value") will works correct :( but

  1. How can I transfer whole array of values to SelectBook Method ?

  2. My javascript is bad and my debugger don't show me javascript errors but it just doesn't works because of something wrong with each.

And ... finally I just need to get array of values of dynamic textboxes and transfer them to server side ... mt [WebMethode] can't see server side :(

[Web.Services.WebMethod]
public static SelectBook(id : array) : string
{
    id
}

And sure I have no idea how can I use jQuery .live and binding here.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript