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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:23:36+00:00 2026-05-25T03:23:36+00:00

I have the following table: <table width=1000 border=1 cellpadding=2 cellspacing=2 bordercolor=#CCCCCC class=WebApps id=addIssue> <tbody>

  • 0

I have the following table:

 <table width="1000" border="1" cellpadding="2" cellspacing="2" bordercolor="#CCCCCC" class="WebApps" id="addIssue">    
        <tbody>
            <tr>
                <td bordercolor="#f0f0e4" bgcolor="#f0f0e4"><h3>Open Issues
                <input type="button" class="button" value="+" id="addNewIssue" name="addNewIssue"/>
               <input type="text" id="txtIndex" name="txtIndex" value="<%=vIndex%>">
                </h3></td>
            </tr>
            <tr>
                <td bordercolor="#FFFFFF" bgcolor="#FFFFFF"><p><textarea id="txtOpenIssues0" name="txtOpenIssues0" cols="100" rows="2"></textarea>
                </p></td>
            </tr>    
        </tbody>                  
        </table> 

And the following JQuery script:

$("#addNewIssue").click
        (
            function() 
            {       

                var iX = document.getElementById("txtIndex").value;
                iX ++;
                document.getElementById("txtIndex").value = iX;     

                $('#addIssue tbody>tr:last').clone(true).insertAfter('#addIssue tbody>tr:last'); 

                //Clear out newly added text field.  
                $('#addIssue tbody>tr:last #txtOpenIssues0').val('');     
                return false;       

            }       
        );  

It works just fine; however, as you can see from my HTML, I am trying to attach an index to the name/id of the text area. So, upon adding a new row using the Jquery script, i would like to change the name and id of the newly added row to match my index. So, row one is txtOpenIssues0, and then the newly added row would contain text field txtOpenIssues1, then add another and it’d be txtOpenIssues2, etc. I have done this successfully without JQuery, but am wanting to try more JQuery solutions. Currently have jquery 1.6.1 Any help is appreciated. Thanks!

  • 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-25T03:23:36+00:00Added an answer on May 25, 2026 at 3:23 am

    With just a little modding of the code I was able to get it working. You can directly change the the id and name of the node after cloning it (.clone(true).attr(...)). and then you just use the index you are already iterating.

    http://jsfiddle.net/FKuWJ/1/

    $('#addIssue tbody>tr:last')
        .clone(true)
        .insertAfter('#addIssue tbody>tr:last')
        .find("textarea")
        .attr("id","txtOpenIssues" + iX)
        .attr("name","txtOpenIssues" + iX)
        .val('');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML table format: <table style=width: 100%;> <tr> <td> //How to
I have the following code, I'm trying to get a table with 4 columns
I have already googled for this I have a Table with following structure in
I have following situation: I have loged user, standard authentication with DB table $authAdapter
I have a table with the following columns: A B C --------- 1 10
I have a table with a structure like the following: LocationID AccountNumber long-guid-here 12345
I have following situation. A main table and many other tables linked together with
I have following table structure: Table: Plant PlantID: Primary Key PlantName: String Table: Party
I have the following table relationship in my database: Parent / \ Child1 Child2
I have the following HTML table is rendered to my browser.I am creating this

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.