Changing an Image from a Select - Simple mistake somewhere?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Changing an Image from a Select - Simple mistake somewhere?

From: <@sh>
Date: Mon Dec 19 2005 - 18:06:44 CET

Need help again! Here's the head script...

----------------------------------------------------------------------------------------
function Ash_ChangePicFromSelect(TheSource,TheDestination) {
    value = TheSource.options[TheSource.selectedIndex].value;
    if (value != '')
        if (document.images)
// document.images['TheDestination'].src = value;
            document.images(TheDestination).src = value;
}
----------------------------------------------------------------------------------------
AND THE BODY...
----------------------------------------------------------------------------------------
<select name="select" class="Style_TextBoxes"
onChange="Ash_ChangePicFromSelect(this,ContentBoxRow1a)">....................</select>
<img src="public/emailtemplates/boxes/title_specialbreaks_left.gif"
width="111" height="19" id="ContentBoxRow1a" name="ContentBoxRow1a">
----------------------------------------------------------------------------------------

Only on making a select from the SELECT box do I get an error, the error
states...

'document.images[...]' is null or not an object

Have I screwed up how I'm passsing the name of the image? Appreciate your
help again geniuses!!
Received on Fri Dec 23 20:25:45 2005