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

  • Home
  • SEARCH
  • 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 1008399
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:45:55+00:00 2026-05-16T08:45:55+00:00

I am adding a row using the clone() function and then am having to

  • 0

I am adding a row using the clone() function and then am having to rename all of the divs in the newly cloned row. I was trying to do that this way:

// Add button for new TOEFL entry
        $("#add-TOEFL").button().click(function( event ){
                event.preventDefault();

                var tag = 'TOEFL',
                    testDate = $("#TOEFLtestDate-0").val(),
                    reading = $("#readingTOEFLScore-0").val(),
                    listening = $("#listeningTOEFLScore-0").val(),
                    speaking = $("#speakingTOEFLScore-0").val(),
                    writing = $("#writingTOEFLScore-0").val(),
                    applicantId = $("#applicantId").val(),
                    dataString = 'applicantId=' + applicantId + '&dateTaken=' + testDate + '&listeningScore=' + listening + '&readingScore=' + reading + '&speakingScore=' + speaking + '&writingScore=' + writing;

                // Insert New Record
                $.ajax({
                    type: "POST",
                    url: "ajax/insertEntry.cfm?xAction=TOEFL",
                    data: dataString,
                    success: function(newIdx){

                        // Make sure returned value is a number
                        newId = jQuery.trim(newIdx) * 1;

                        // clone new row
                        newDivId = tag + '-Entry-' + newId;
                        newRow = $('#' + tag + '-Entry-0').clone().attr('id', newDivId);
                        console.log('New row cloned. DivId: ' + newDivId);

                        // get all ids
                        $("#" + newDivId).find("[@id$='-0']").each(function(){
                            selectedDivId = $(this).attr("id");
                            alert(selectedDivId);   
                        })  

                    }
                })

Here is the HTML markup:

<div id="TOEFL-Entry-0" style="display: none" >          
        <p style="margin:5px 0 0 0">
            Taken  <input name="TOEFLtestDate-0" type="text" id="TOEFLtestDate-0" class="inputDateField" style="margin-left:5px; margin-right:15px;"/>
            Reading <input name="readingTOEFLScore-0" type="text" id="readingTOEFLScore-0" class="inputTinyScoreField" style="margin:0 8px 0 5px"/>
            Listening <input name="listeningTOEFLScore-0" type="text" id="listeningTOEFLScore-0" class="inputTinyScoreField" style="margin:0 8px 0 5px"/>
            Speaking <input name="speakingTOEFLScore-0" type="text" id="speakingTOEFLScore-0" class="inputTinyScoreField" style="margin:0 8px 0 5px"/>
            Writing <input name="writingTOEFLScore-0" type="text" id="writingTOEFLScore-0" class="inputTinyScoreField" style="margin:0 8px 0 5px"/>
            <button id="add-TOEFL-0">Add</button>
        </p>
    </form>
</div>

Even thought there should be a bunch of ids that match this criteria, I am not seeing the alert.

What am I doing wrong?

Josh

  • 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-16T08:45:55+00:00Added an answer on May 16, 2026 at 8:45 am

    Thanks for all the help.

    The problem was actually that the cloned row was not shown yet and needed to be referenced as ‘newRow’ instead of as $(“#” + newDivId).

    Once I changed that, it works like a champ.

    Not quite sure why that is the case, but that makes it worse.

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

Sidebar

Ask A Question

Stats

  • Questions 512k
  • Answers 513k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer You need to drop the selector and use the transition… May 16, 2026 at 5:46 pm
  • Editorial Team
    Editorial Team added an answer Depending on what access you have on the server you… May 16, 2026 at 5:46 pm
  • Editorial Team
    Editorial Team added an answer Load the fileReference.data into a Loader using loadBytes(). Then you'll… May 16, 2026 at 5:46 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

When adding a row dynamically using jQuery DataTables plugin , what do I do
Problem I have a custom tab control using Chrome-shaped tabs that binds to a
I have an app using a ListView as a main screen. Each row displays
I was looking at adding rows dynamically to my HTML table using jQuery with
In my web application, I was dynamically adding/deleting rows from my HTML table using
I'm looking for suggestions on how to go about adding a ListView selector that
I am trying to search for any string that contains ; in a column
I'm importing data from an Excel sheet on to a DataTable using the following
Apple's documentation on UITableView discusses how to add/edit/delete rows, but it doesn't discuss adding/editing/deleting
How has Apple designed the View that you get when you look at an

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.