RogerB Posted November 14, 2011 Report Share Posted November 14, 2011 Has anyone made code to show a preview if the signature image for the edit_profile.tpl?? I want to show the pilots a preview of the image for the drop down box. Quote Link to comment Share on other sites More sharing options...
Jeff Posted November 14, 2011 Report Share Posted November 14, 2011 You should be able to direct link to the image with this Roger. www.yoursite.com/lib/signatures/background/background.png Quote Link to comment Share on other sites More sharing options...
freshJet Posted November 15, 2011 Report Share Posted November 15, 2011 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.