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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:10:39+00:00 2026-05-20T18:10:39+00:00

I have a table with an arbitrary number of rows. In the first cell

  • 0

I have a table with an arbitrary number of rows. In the first cell in each table is an image with an onclick call to a javascript function, and a hidden field with the ID of the row. The call to the javascript function looks like:

<td>
    <a href="#" onclick="doSomeAction(this); return false;" title="Do Something">
        <img src="<?php echo($this->baseUrl());?>/images/btn_add.png" width="20" height="20" alt="Add" />
    </a>
    <input type="hidden" name="rowid[]" value="123" />
</td>

In my Javascript, I would like to retrieve the value of the id[] field. I tried to access it as follows:

var x = obj.parentNode.childNodes;
var i,j = x.length;
for ( i=0; i<j; i++ ) {
    if ( 'rowid[]' == x[i].nodeName.toLowerCase() ) {
        inp.value = x[i].value;
    } else {
        inp.value = 999;
    }
}

In all cases, this returns 999 as the value, indicating that it cannot locate the child node. What is not being done correctly here?

  • 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-20T18:10:40+00:00Added an answer on May 20, 2026 at 6:10 pm

    x[i].nodeName is the name of the element, e.g. INPUT, A, TD, DIV, etc. If you want to keep down this path, just check .name or .getAttribute('name')

    Also, x should probably be obj.parentNode.parentNode.childNodes since the parentNode is the A tag.

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

Sidebar

Related Questions

I have a mysql table, each row of which can have an arbitrary number
I have a table of user-uploaded objects. Each user can have an arbitrary number
I have a Table that has an arbitrary amount of Rows. In these Rows
I have a DataTable containing an arbitrary number of columns and rows which I
I have a table with multiple rows. Each row is a form. I want
I have table in data base name train delay, with columns train number(int), DelayTime(int),
I have table 'products' and I need to update 'price' field by 20% if
I have a table to entities (lets call them people) and properties (one person
I have MySQL table with the following structure: +---------+--------------+------+-----+---------+----------------+ | Field | Type |
I have written a php script that returns an arbitrary number of specific ids

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.