Jump to content

Preview image from Dropdown...


spikypunker

Recommended Posts

Hey guys :)

 

Am trying to develop a page where a user has a dropdown box and chooses an image. I found a simple script that achieves this usign javascript here:

 

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Brand IT - Home page</title>
<link rel=stylesheet href="brandit.css" type=text/css></link>

<script language="javascript">

function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}

</script>

</head>

 

 

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery" action="mail.php" method="post"><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="http://www.#.co.uk/emails/gocruise/images/header1.jpg">Picture of me</option>
<option value="http://www.#.co.uk/emails/gocruise/images/header3.jpg">Picture of my aunt</option>
<option value="http://www.#.co.uk/emails/gocruise/images/header2.jpg">Picture of my brother</option>
</select>
<input name="" type="submit" />
</p>
</form>
</td>
</tr>
<tr>
<td width="100%"><p align="center"><img src="http://www.#.co.uk/emails/gocruise/images/header1.jpg" name="pictures" width="99" height="100"></td>
</tr>
</table>

 

 

This works really well, but as soon as i add a SUBMIT button with an action and method, it stops working....

 

I guess i can understand why it does this but i cant think of a way to make it work. The idea is the user chooses the image and then a couple of other fields and then a mailer.php page sends an email with the choices they made.

 

 

Does anyone know how this is possible?

 

 

Kind Regards, Chris H

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

×
×
  • 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.