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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:23:14+00:00 2026-06-04T02:23:14+00:00

I’m having some issues with getting a parent nodes id to display in entirety.

  • 0

I’m having some issues with getting a parent nodes id to display in entirety.

I’m using a loop to detect div elements within a table, then I’m having it find the parent TD node and in another variable it gets the id off of that.

My problem is that during this loop im building a variable upon itself with this TD id inside an array and when it prints, the first time it will only show the first character, then the second time it will only show the 2nd character and any time after that will come up blank.

if i remove the array from the variable it will print the entire id, but it renames the old values to the most recent each time the loop runs.

Can someone help me figure this out?

Any help is appreciated, Thanks in advance.

Heres the function im writting

test.save = function () {

var cell = rd = REDIPS.drag,
    page1a = document.getElementById(redips.p1a),
    divs = TableID.getElementsByTagName('DIV'),
    rd.find_parent('TD', rd.obj),     //parent cell
    st = cell.id,                           //parent cell ID
    st,                     
    id,                                     //div id
    cid,                                   //cell id    
    ccid, 
    concatenator,                         // concatenate oDiv ID
    query = '',
    div,                                // current DIV element
    i;                                  // loop variable

    for (i = 0; i < divs.length; i++) {

    // set current DIV element
    div = divs[i];

    // set current TD ID
    cid = st[i];

    if (div.className.indexOf('drag') > -1) {

                    //takes two characters off of the DIV ID only
        concatenator = div.id.substring(0, div.id.length - 2);

        // creates the query through the loop
            query += cid + '=' + concatenator + ' ';
        }
}

     if (query.length > 0) {
     document.getElementById('message').innerHTML = query;
}
    };

heres a link to a version using an array with the TD ID: http://stevenschemers.com/beta1/

and heres a link to a version not using an array for the TD ID: http://stevenschemers.com/beta2/

I also noticed, it seems like the loop if running twice, because ‘i’ will count up 0, 2, 4, 6. or sometimes 1, 3, 5, 7

  • 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-04T02:23:16+00:00Added an answer on June 4, 2026 at 2:23 am
    // loop goes through each DIV element collected on the left side of page 1
    for (i = 0; i < divs.length; i++) {
        // set current DIV element
        div = divs[i];
    
        if (div.className.indexOf('drag') > -1) {
            // sets current cell ID for dropped div
            cid = rd.find_parent('TD', div).id;
    
            concatenator = div.id.substring(0, div.id.length - 2);
            // creates the query through the loop
                querya += cid + '=' + concatenator + '&';
                qc++;
            }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and

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.