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 8602129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:00:24+00:00 2026-06-12T02:00:24+00:00

I have hard time to find textbox values in my repeater control. On button

  • 0

I have hard time to find textbox values in my repeater control. On button click i need to get textbox value corresponding to textbox which are inside of button which is clicked.

So i have :

Textbox1 —> which have to be bound with Button1
TextBox2 —-> which is bound with Button2

<span>Question :</span><span>my second content <br /></span><span>Answer : </span><input name="ctl00$MainContent$ctl00$ctl00$TextArea" type="text" id="MainContent_ctl00_TextArea_0" value="6454" />

Add Question


Question :abcdedf
Answer : Add Question

Right now i have jquery function which get which is clicked:

 $(".addAnswerButton").click(function () {

        //var quantityBox = $("#TextArea", $(this).parent());
        var tr = $(this).closest("text")
        alert(tr.val());
        //quantityBox.text = "Hello there";
        //var currentValue = quantityBox.val();
        $(this).siblings('input[type="text"]').first().val("clicked");

        //quantityBox.val(parseInt(currentValue) + 1);
    });

Ive got it working partially with:

$(this).siblings('input[type="text"]').first().val("clicked");

Where i get set textbox text, but then again, if i click second button, nothing happends.

What an i doing wrong? How can i get value from specific textbox?

UPDATE

now i go with solution where i add custom attribute to each control:

    <span>Question :</span>
<span>my second content <br /></span>
<span>Answer : </span>
<input name="ctl00$MainContent$ctl00$ctl00$TextArea" type="text" id="MainContent_ctl00_TextArea_0" value="654" mydataid="2" />

    <button id="MainContent_ctl00_answerQuestion_0" Class="addAnswerButton" onclick="Click()" mydataid="2" >Add Question</button><hr /><span>Question :</span><span>abcdedf <br /></span>

    <span>Answer : </span><input name="ctl00$MainContent$ctl00$ctl01$TextArea" type="text" mydataid="1" id="MainContent_ctl00_TextArea_1" value="654" />

    <button id="MainContent_ctl00_answerQuestion_1" Class="addAnswerButton" onclick="Click()" mydataid="1">Add Question</button>​

So right now i can get custom atribute from onclick event by doing this:

$(".addAnswerButton").click(function() {
    var pos = $(this).attr("mydataid");
    alert(pos);
 //   $(this).siblings('input[type="text"]').first().val("clicked");
});

But how do i get textbox control which have samme custom attribute name as button?

Update 2

After 70 tryes i finally figured it out (my first tryes with Jquery)

solution

$(".addAnswerButton").click(function() {
    var pos = $(this).attr("mydataid");
    results = $('input[type = "text"][mydataid="'+pos+'"]').first();
    alert(results.val());
});

So point is, you are getting custom attributes “name”, and then searching for a textbox with same attribute name.

  • 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-06-12T02:00:26+00:00Added an answer on June 12, 2026 at 2:00 am

    You can mark them from server with some attribute and use it in your jQuery code.

    The output from server would be like this:

    <input type='text' data-item-id='1'>First</input>
    <inpyt type='button' data-item-id='1'></input>
    
     <input type='text' data-item-id='2'>Second</input>
        <inpyt type='button' data-item-id='2'></input>
    

    After that once button is pressed, get it’s data-item-id and search for textbox with the same attribute value.

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

Sidebar

Related Questions

I'm a developer, and I find that I have a hard time dealing with
I have a really hard time to find how downloading a file with the
I have a hard time to find any examples for NSURLConnection delegate method implemenetations.
i have been having a hard time to find anything that is usefull but
I am coming from C# background and I have hard time figuring out how
I have a hard time figuring this one out, it's about mistakes that can
I have a hard time grasping this. When writing in do notation, how are
I understand the principles but i have a hard time seeing where the practical
I've recently been learning jQuery Mobile but have a hard time remembering all the
While there are many guides for Browser Helper Objects, i have a hard time

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.