Drop Down Box with Image as button - Drop Down Box with Image as Button
Is there anybody out there who knows how to use a drop down box with an image for a button. When I do it the x and y co-ordinates show up in the URL. How do I overcome this problem! Thanks for the help!
----------
Marc de Jong
John Pollock posted this at 22:16 — 15th June 1999.
He has: 628 posts
Joined: Mar 1999
Try it this way and see if it works:
<SCRIPT language="JavaScript">
<!--
function goto()
{
window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value;
}
//-->
</SCRIPT>
<FORM name="guideform">
<SELECT name="guidelinks">
<OPTION SELECTED value="page1.htm">Page 1
<OPTION value="page2.htm">Page 2
</SELECT>
<A HREF="javascript:goto()"><IMG SRC="yourimage.gif" border="0"></A>
</FORM>
----------
John Pollock
http://www.pageresource.com
Java Script: A Beginner's Guide
Page Resource
Anonymous posted this at 01:08 — 16th June 1999.
They have: 5,633 posts
Joined: Jan 1970
Hi,
Wouldn't be easier this?
<FORM name="guideform">
<SELECT name="guidelinks">
<OPTION SELECTED value="page1.htm">Page 1
<OPTION value="page2.htm">Page 2
</SELECT>
<INPUT type="image" src="image.gif">
</FORM>
This way you don't have to use JavaScript (statisitcs show that more than 10% of surfers have JS turned off on their browsers )
Cheers
----------
wdresources
http://www.wdresources.com
mdejong posted this at 02:20 — 16th June 1999.
They have: 2 posts
Joined: May 1999
I tried the two above examples. The 1st one using the function does not seem to work. I have done exactly what was written. When I click on the image it dosen't go anywhere. I see the logic behind it and don't see why it wouldn't work!
The second example given still gives the x y co-ordinates in the URL.
Any other suggestions?
----------
Marc de Jong
John Pollock posted this at 17:16 — 16th June 1999.
He has: 628 posts
Joined: Mar 1999
Hmm..
It worked for me, if you post your url I can take a look at it and see if I can figure out what is going wrong.
Oh, what browser/os are you using. It may make a difference here.
----------
John Pollock
http://www.pageresource.com
Java Script: A Beginner's Guide
Page Resource
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.