Im sure I had seen something like what I am after on here previously but can not find it.
I have a simple list/select box that has a list of image names in it.I want to be able to select one of the image namesd and it will display it to the right of the box.This is what I have come up with after a lot of searching.
Javascript
:
Code:
$(document).ready(function(){
$("#MyImage").bind('change', function() {
var update_pic = $(this).val();
if (update_pic) {
$('#NewPic').attr('src', 'indices/icons/' + update_pic + '' );
}
});
});
HTML:
Code:
<select id="MyImage">
<option selected="selected"> </option>
<option value="image.png">image.png</option>
<option value="java.png">java.png</option>
<option value="js.png">java.png</option>
</select>
<img id="NewPic" src="#" alt="" />
Now this seems to be perfect except I would like to have multiple list box's.From what I have tried to research it may appear that I have to make it selector based?
Any help would be greatly appreciated