Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:21+00:00 2026-05-27T04:38:21+00:00

i searched a lot on NET, to get the solution, but i could not

  • 0

i searched a lot on NET, to get the solution, but i could not find

Can anyone tell me how to access the label and textbox values of repeater control inside using the javascript ?

This is my code

 <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <ItemTemplate>
        <table id="t1" width="200px:" style="background-color: skyblue" runat="server">
            <tr>
                <td>
                    <asp:TextBox ID="TextBox3" Text='<%#DataBinder.Eval(Container.DataItem, "empid")%>'
                        runat="server" />
                    <asp:CheckBox ID="CheckBox1" runat="server" />
                    <asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "empid")%>'></asp:Label>
                    <asp:Label ID="lblname" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "ename")%>'></asp:Label>
                    <br />
                    <br />
                </td>
            </tr>
        </table>
    </ItemTemplate>
</asp:Repeater>

Now i want to access the label, textbox of repeater using javascript

@Diodeus

I tried your code

function submitAll() {
        var thisLabel = $('.myLabel').eq(0);
        alert(thisLabel);
    }

But i got the result in alert as

[object Object]

and @deostroll

I tried your code this way

But not getting anything

    function GetData() {
        var arrTables = document.getElementById('myDiv').getElementsByTagName('table');
        var tbl = arrTables[0];
        var td = tbl.childNodes[0].childNodes[0].childNodes[0];
        var txt = td.childNodes[0];
        alert(txt.value);        
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:38:22+00:00Added an answer on May 27, 2026 at 4:38 am
    <asp:Label ID="Label1" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "empid")%>'></asp:Label>
    

    IDs must be unique, so you can’t apply the same ID to all of the labels in your repeater. Use CSS class names instead.

    <asp:Label CssClass="myLabel" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "empid")%>'></asp:Label>
    

    Since jQuery comes with .NET you can use it instead of plain JavaScript to access these elements more easily.

    var thisLabel = $('.myLabel').eq(0) where 0 is the index of the element since there can be many.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched around a lot for a solution, but could not find any.
I have searched a lot but I could not find any good solution to
I searched a lot but could not find a way to dump table relations
I have searched a lot and tried much but I can not find the
I searched a lot but I can't find an answer. In my contact.php I
I've searched a lot within SO but I can't find the right answer for
I have searched a lot to find a solution for my problem, but I
I searched a lot in google but not able to get the answer required.
Hy there I searched a lot on google, but couldn't find an answer. Maybe
I searched a lot to get rid of this problem on the internet but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.