Jump to content

Help with Search and Report Datapage javascript example


Recommended Posts

Hello all, new to both js and the forum.

I am trying to use one of the js solutions from the forum (to help me write some other code) and for the life of me cannot get it to work. The topic is this link: http://forums.caspio.com/viewtopic.php?f=14&t=12232. I have put it in the Header section exactly how it says to do making only one change; I changed the [columnnumber] from "0" to "4" so I could place the "Label" over the fifth column instead of the first. Here is the code exactly how it is pasted into the Header section of my Elements box.

function HeaderLabel()

{

/* (1) Get the results table and rows */

var tbl = document.getElementsByTagName("table")[1];

var rows = tbl.getElementsByTagName("tr");

/* (2) Get the header row’s data cells */

var colheader = rows[4].getElementsByTagName("td");

/* (3) Assign a label to the first data cell */

colheader[0].innerHTML="Label";

window.onload = HeaderLabel;

}

Would anyone have any idea why this code does not bring up anything at all? When I run it through Firebug it tells me that "var colheader = rows[4]..." is undefined. Any help would be appreciated.

thx,

Zig

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...