Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change img in cell by clicking on a checkbox

Status
Not open for further replies.

LebronJames

Programmer
Apr 5, 2003
93
I have a html that is displaying two frames. Page1 and Page2

In Page1, I have a table of 2 rows and 2 columns. In Column1 Row1 I have an image. In Page2 (within the frame) I have a check box, one check box to change the picture in row1 column1 and a second checkbox to change the picture in row2 column1.

Does anyone know how to if you click the 1st checkbox in page2, it will change the img in page1 row1 column1 to another img? And if a user clicks the 2nd checkbox in page2, then the img in row1 column2 will change to another image.

Is this possible? HOW?? LOL
 
you can have an onclick="" for the checkbox. Example...

onclick="document.getElementById('myImage').src='checked.png';"

It would be better to put it through a function with an if statement, but you get the idea - I hope.

----------
I'm willing to trade custom scripts for... [see profile]
 
Oh, for frames you need to reference the parent frame and then the target frame...

parent.target.document.getElementById('myImage').src=''

If this doesn't make sense, a full answer can be posted if you share the URL or give more information

----------
I'm willing to trade custom scripts for... [see profile]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top