JayC
Well-Known Member
Code:
<script type="text/javascript">
$('#choose').change(function(){
var image = $("#choose option:selected").data('image');
$('#selected').attr("src", image);
});
</script>
<select id="choose">
<option selected="selected">Choose Image</option>
<option data-image="http://aeon-hotel.net/r63/c_images/groups/POKE1.gif"> Image One </option>
<option data-image="http://aeon-hotel.net/r63/c_images/groups/ES079.gif"> Image Two </option>
<option data-image="http://aeon-hotel.net/r63/c_images/groups/ES078.gif"> Image Three </option>
</select>
<img id="selected" src="//placehold.it/50x50/aaaaaa" />
When I select a image it doesn't automatically update...
Tag the smart guy @Sysode
Also if you wouldn't mind helping me with php too..
The option-data has to be a link <option data-image="/r63/c_images/groups/POKE1.gif">
but what goes in my database is just the "POKE1" and I need to know how to truncate "/r63/c_images/groups/" because thats always the same and ".gif" thats also always the same
@Markshall lol that previous thread was all because i forgot <script text/javascript> </script> lmao. This is the real help needed