Forum Moderators: open

Message Too Old, No Replies

passing javascript variable as a link

looking to pass the value from select box to a link

         

hughie

12:31 pm on Aug 17, 2005 (gmt 0)

10+ Year Member



I am totally stumped on this.

I have a list
<form name="form1">
<select name="select1">
<option value="1">one</option>
<option value="2">two</option>
<option value="3">three</option>
<option value="4">four</option>
<option value="5">five</option>
</select>
</form>

what i want to have next to it is a link saying
"preview image"
which when clicked on opens a page and pulls out the corresponding image from the database relating to the value in the list.

The bit i can't get is how to include the selected value of the list as part of a link and allow it to change on the fly as the selection changes.

make sense?

Cheers,
hughie

Dijkgraaf

2:41 am on Aug 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about
<select name="select1" ID="Select1" onchange='document.location="PAGEHERE.htm?value="+form1.select1.value;'>