ev5unleash Posted April 15, 2009 Share Posted April 15, 2009 Hey Guys, I'm trying to make a page with a table that has a background image. I want to be able to create a button that will change the table background image to something else. http://ev5unleash.dnsalias.org:1212/websites/sbsolution/index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Evan's Smartboard Solution</title> <script type="text/javascript"> <!-- function MM_popupMsg(msg) { //v1.0 alert(msg); } //--> </script> --> </style> <link href="hpstype.css" rel="stylesheet" type="text/css" /> </head> <body> <table id="tblbg" class="wizard" border="0" align="center"> <tr> <td width="9" height="21"> </td> <td colspan="3"> </td> <td width="10"> </td> </tr> <tr> <td height="417"> </td> <td colspan="3" align="left" valign="top"><table width="100%" border="0"> <tr> <td width="87%" class="windowheader">Welcome - Setup Wizard (1.0)</td> <td width="13%" align="right"> <input name="button2" type="button" id="button2" onclick="MM_popupMsg('Press and hold Alt + F4 to close.')" value="X" /> </td> </tr> </table> <p class="text">Weclome to Evan's Smartboard Solution (Rev. 1), This wizard will guide you though how to use the smartboard solution and get everything working in no time.</p> <p class="text"> <input type="button" name="button" id="button" value="Button" onmousedown="document.getElementById('tblbg').src='systemfiles/images/red7x5.png';" /> </p> <p> </p></td> <td> </td> </tr> <tr> <td> </td> <td width="135" valign="top"> <input type="button" name="Exit" id="Exit" onclick="MM_popupMsg('Press and hold Alt + F4 to close.')" value="Exit" /> </td> <td width="366" align="center" valign="top"><input type="button" name="Start" id="Start" value="Start Smartboard Solution" /></td> <td width="158" align="right" valign="top"><input type="button" name="Next" id="Next" value="Next" /></td> <td> </td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/154264-solved-change-image-button/ Share on other sites More sharing options...
xtopolis Posted April 16, 2009 Share Posted April 16, 2009 document.getElementById("ID_OF_TABLE_GOES_HERE").style.backgroundImage = "url(../images/img.gif)"; ? Your use of tables makes me cry. Quote Link to comment https://forums.phpfreaks.com/topic/154264-solved-change-image-button/#findComment-811103 Share on other sites More sharing options...
ev5unleash Posted April 18, 2009 Author Share Posted April 18, 2009 lol, thanks. I'll see if that works. And what's annoying you about my tables? I only use them this way because it's the only way for them to look good in IE. Quote Link to comment https://forums.phpfreaks.com/topic/154264-solved-change-image-button/#findComment-813323 Share on other sites More sharing options...
xtopolis Posted April 18, 2009 Share Posted April 18, 2009 because it's the only way for them to look good in IE. Perhaps, perhaps not. Quote Link to comment https://forums.phpfreaks.com/topic/154264-solved-change-image-button/#findComment-813356 Share on other sites More sharing options...
ev5unleash Posted April 18, 2009 Author Share Posted April 18, 2009 Yeah, there might be other ways. But I have no idea what those other ways are. Quote Link to comment https://forums.phpfreaks.com/topic/154264-solved-change-image-button/#findComment-813385 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.