Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Beer on me for help!! Using an image as input for a list on a form

Status
Not open for further replies.

ecupirate

Programmer
Apr 18, 2002
5
US
Hey guys,

Im having problems using an input type of "image" on my form. I would like to click the image next to my list and go to that new webpage. For example, if the user selects bears from the list, they will go to For some reason it seems to be using my website name || with the new url. Any help will get you a beer on me!!!! Here is my code:
<body>
<form name=&quot;c809&quot;>
<p><select name=&quot;c748&quot; size=&quot;1&quot;>

<option selected value=&quot; <option value=&quot; <option value=&quot; </select>
<INPUT TYPE=&quot;image&quot; src=&quot;HdrIconGO.gif&quot; NAME=&quot;point&quot;
onClick=&quot;location=document.c809.c748.options[document.c809.c748.selectedIndex].value&quot;></p>
</form>
 
<input type=image> acts like a submit button.

You could use a normal image to do the same thing but you could also try doing this :

<form name=&quot;c809&quot; onsubmit=&quot;return false&quot;>

Hope this helps. Gary Haran
 
Hi,

INPUT TYPE=IMAGE is the same as INPUT TYPE=SUBMIT, so the page is submited to the same url.

Try to use <IMG src=&quot;HdrIconGO.gif&quot; NAME=&quot;point&quot; onClick=&quot;location=document.c809.c748.options[document.c809.c748.selectedIndex].value&quot;>

Sergio.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top