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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:06:01+00:00 2026-05-29T07:06:01+00:00

How do I get the value clicked in each row (generated using AddRowTable plugin),

  • 0

How do I get the value clicked in each row (generated using AddRowTable plugin), i.e.,

<script type="text/javascript">
$("document").ready(function(){
$(".addRow-Max4").btnAddRow({maxRow:4, inputBoxAutoNumber:true});
$(".delRow").btnDelRow();
});
</script> 

generates maximal 4 rows in a table and numbers each input box, so I get textfield1, textfield2 and so onin my table.

<table border="0" >
<tr>
    <th colspan="2">Input your data</th>
    <th><input type="button" value="Add Row" class="addRow-Max4"/></th>
</tr>
<tr><td>
    <a href="#" class="autofill">Apple</a> 
    <a href="#" class="autofill">Banana</a> 
    <a href="#" class="autofill">Mango</a>
    </td><td><input type="text" name="textfield" class="autofill" size="25"/></td>
    <td><img src="./images/cross.gif" class="delRow" border="0"></td>
</tr>
</table>

Now I might decide for Apple in row1, Mango in row2 and so on and would like that the according textfield for this row is filled.

I have

$("a[class=autofill]").live("click", function(){
$("input[name=textfield1]").val($(this).text());
return false;
});

but how do I have to adjust it to make it dynamic for each row. Let’s say textfield1, textfield2, textfield3 and so on. As it is right now, I change the textfield1 each time a link is clicked. But I want to just change it if one of the corresponding (same row) link is clicked.

  • 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-29T07:06:02+00:00Added an answer on May 29, 2026 at 7:06 am

    Did not get much of the insight for this issue. But here is my try to find all the input fields inside their parent TR.

    $("a[class=autofill]").live("click", function(){
        $(this).closest('tr').find("input").val($(this).text());
        return false;
    });
    

    This is what i tried:

    http://jsfiddle.net/KU6Xw/

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

Sidebar

Related Questions

I am trying to get the html value of a linked clicked. The links
how to get value without <br/> tag using regex n java? my String is:
i'm using div content editable html to get value from input keyboard to post
I need to get the value of the item clicked and the name of
I need to get the value of the item clicked and the name of
<table> <tr><td> <div><img src=1.jpg>text<span class=get>aa</span> <span class=click>Get value</span></div></div></td></tr> <tr><td> <div><img src=2.jpg>text<span class=get>bb</span> <span class=click>Get
I need to get attribute value of clicked element, but I have an ajax
I am trying to get the value of a clicked anchor but I am
In this jsfiddle http://jsfiddle.net/littlesandra88/eGRRb/ have I submit buttons that are auto-generated. Each table row
How i can get value of checked radio button in radio button list.Here is

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.