Hey there,
I’ve been trying to make an array that shows pictures when users click a button. The code I’ve written was sort of based off a code I wrote previously, where the price would show up in a text box when users clicked a button. However, I’ve been unable to get it to work with pictures. This is the function I wrote:
[code=php]
disPictures = new Array(“filler2.jpg”, “hexigon.jpg”,”cedartraditional.jpg”,”bilevel.jpg”,”specialsizes.jpg”)
function setdisplayPictures(myForm) {
document.DeckMenu.DeckPic.value = “”
var listSelect = myForm.DeckList.selectedIndex
document.DeckMenu.DeckPic.value = disPictures[listSelect]
}
I placed onClick=”setdisplayPictures(DeckMenu)” in the button tag, where DeckMenu is the form name and DeckList is the selection list name. I also named the placeholder picture “DeckPic”.
Thanks for your help!