The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Displaying image from drop down, trying to display image from drop down in form and retain data
thejrod03
post Nov 6 2006, 01:57 AM
Post #1





Group: Members
Posts: 1
Joined: 6-November 06
Member No.: 721



I have been trying to work this through for hours and cant seem to get it. What I am trying to do is in a form use a drop down menu to display an image but also when the option is selected to retain the value to be processed into a database. heres the basis of what I have...

<script language="javascript">
<!--

/*Combo Box Image Selector:
By JavaScript Kit (www.javascriptkit.com)
Over 200+ free JavaScript here!
*/

function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.origin_state.options[document.mygallery.origin_state.selectedIndex].value
}
//-->
</script>
<form name="mygallery">
<Form action="http://www.onedispatch.com/test/loadposting.php" Method=Post>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<th width="50%"align="center" valign="middle">

<P>Please Select Origin State:<br>
<select name="origin_state" onChange="showimage()">
<option value="AL">AL</option>
<option value="http://www.onedispatch.com/test/michiganarea.JPG">AK</option>
<option value="AZ">AZ</option>
<option value="AR">AR</option>
<option value="CA">CA</option>
<option value="CO">CO</option>
<option value="CT">CT</option>
</select>
<img src="me.gif" name="pictures" width="99" height="100">
<p>Please enter origin area:<br>
<input type=text name="origin_area" size=25" id=origin_area>



</td>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 23rd October 2014 - 07:23 AM