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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:55:55+00:00 2026-05-15T19:55:55+00:00

Friends, I have written the following JavaScript to ascertain which row of an tabular

  • 0

Friends,

I have written the following JavaScript to ascertain which row of an tabular form the user is currently on. i.e. they have clicked a select list on row 4. I need the row number to then get the correct value of a field on this same row which I can then perform some further processing on.

What this JavaScript does is get the id of the triggering item, e.g. f02_0004 This tells me that the select list in column 2 of row 4 has been selected. So my Javascript gets just the row information i.e. 0004 and then uses that to reference another field in this row and at the moment just output the value to show I have the correct value.

<script language="JavaScript" type="text/javascript">
   function cascade(pThis){      
      var row = getTheCurrentRow(pThis.id);
      var nameAndRow = "f03_" + row;
      var costCentre = $x(nameAndRow).value;
      alert("the cost centre id is " + costCentre);

}
   // the triggerItem has the name fxx_yyyy where xx is the column number and 
   // yyyy is the row. This function just returns yyyyy    
   function getTheCurrentRow(triggerItem){   
      var theRow = triggerItem.slice(4);
      return theRow;         
}

Whilst this works I can’t help feeling that I must be re-inventing the wheel and that
either, there are built-in’s that I can use or if not there maybe a “better” way?

In case of need I’m using Apex 4.0

Thanks in advance for any you can provide.

  • 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-15T19:55:55+00:00Added an answer on May 15, 2026 at 7:55 pm

    Well, what you have described is exactly what I typically do myself!

    An alternative in Apex 4.0 would be to use jQuery to navigate the DOM something like this:

    var costCentre = $(pThis).parents('tr').find('input[name="f03"]')[0].value;
    

    I have tested this and it works OK in my test form.

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

Sidebar

Related Questions

I have 4 tables... users, friends, articles & article_shares (as in written) A user
this is my algorithm that I have written it with my friends (which are
friends, i have written following layout code and buttons to be displayed on screen
I have written the following Midje test: (fact (followers-minus-friends ...name...) => [Dude] (provided (idset
I have written this query which returns a users friends and the friends on
I have the following friends = [{ name: Jack, attr1:def, attr2:def }, { name:
I have created an invite friends code, which is properly working if an FB
I have a table named friends with following structure: id, from_id, to_id, confirmed, ....
I have written the following code: #include <iostream> using namespace std; template <class T>
Hi Friends i have written an Activity like below. SplashScreen.java public class SplashScreen extends

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.