Jump to content

I need help


PakiGangsta

Recommended Posts

Alright I am trying to do thi
[code]
<form action='mywebpage.php' method='POST'>
<select name='bird'>
<option value='bigbird'>BigBird</option>
<option value='medium'>Medium Bird</option>
<option value='smallbird'>Small Bird</option>
</select></form>
<img src='img/bird/bigbird.gif'>
[/code]

I am wondering how can i use javascript to change that image on the bottom when i choose smallbird or back to bigbird
Link to comment
https://forums.phpfreaks.com/topic/34350-i-need-help/
Share on other sites

try

<select name='bird' onchange="document.getElementById('birdimage').src='img/bird/' + this.value + '.gif';">
<option value='bigbird'>BigBird</option>
<option value='medium'>Medium Bird</option>
<option value='smallbird'>Small Bird</option>
</select></form>
<img src='img/bird/bigbird.gif' id="birdimage">

Link to comment
https://forums.phpfreaks.com/topic/34350-i-need-help/#findComment-161620
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.