javascript to highlight table row in opener window

I have a page that contains an HTML table.  Within a cell in each row, I have an edit image and when clicked, opens a new window with target='_blank'.   On that newly opened widow, if the user successfully updates and save the form data that is presented, I want to highlight the row on the calling window's table with background green.  If they did not successfully save the form I want to highlight the row on the calling window's table with background silver.

The same javascript file is used within the parent and newly opened window.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hi mamuscia,
I think you should have listed this question in JavaScript zone not JavaScript Frameworks.

However I've written a simple example for you that does your request, you can modify it as you like.

Simply the function will assign an ID to the <tr> where the launch button or link was clicked, then the child window will pass the requested classname to that <tr> element in the parent window depending on your result.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mamusciaAuthor Commented:
Your solution works standalone.  I'm trying to retrofit it to my code and have exactly as you have coded and it does not work.  The difference between my code and yours is that I already have an ID assigned to the table row and pass it to the external page, then pass it back to the JS file.

Do I need to hard code a literal in the getElementById?  I used firebug and the variables contain the correct values.  
<tr id='row1'>
<td align='left' valign='top' bgcolor='#ffffff'>
<a href='javascript:void(0);' onclick='editscreen(this, "2010-03-07", "010BZ", "SLO2", "OS", "row1")' title='Edit this record'>   <img src='images/icon_edit.gif' border='0' alt='Edit Record'></a>

function editscreen(el, date_closed, ticket_num, slo, service_category, rowid) {
  var url = "indexqaedit.php";
  var parms = "?date_closed="+date_closed+
  var winparm = url+parms;
  editwin =,'editwin','scrollbars=yes,menubar=no,resizable=yes,toolbar=no,location=no,status=no');

<input type='button' name='cancel' value='Cancel' class='buttonGO' onclick='highlightTableRow("row1", "td_silverbkgrnd");'/>

function highlightTableRow(rowid, classname) {

Open in new window

mamusciaAuthor Commented:
Tried it again and it works like a charm.  thanks.
I misspelled getelementbyid.....!!!
Great, I was about to look into it again.
Glad it worked for you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.