Jump to content

Recommended Posts

Posted

NOTE: I have just tested this and it doesn't work. You may need to play around a bit.

Try this:

<script type="text/javascript">
window.onload=function()
{
bp='http://www.yoursite.com/lib/signatures/', //base url of your images
imgnum=3, //Number of images. This should match on your comboboxes options.
thumb=document.getElementById('bgimage'), //id of your image that will be changing
combobox=document.getElementById('sig'); // id of your combobox.

combobox.onchange=function()
{
bgimage.src=bp+'<?php echo $pilotinfo->code; ?>'+'.png';
}
}
</script>

For the dropdown:

<dt>Signature Background</dt>
<dd><select id="sig">
	<?php
	foreach($bgimages as $image)
	{
		if($userinfo->bgimage == $image)
			$sel = 'selected="selected"';
		else	
			$sel = '';

		echo '<option value="'.$image.'" '.$sel.'>'.$image.'</option>';
	}
	?>
</select>
<br>
<img src="http://www.yoursite.com/lib/signatures/<?php echo $pilotinfo->code; ?>.png" id="signature">
</dd>

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...