Link to home
Start Free TrialLog in
Avatar of MOSTAGHASSI
MOSTAGHASSIFlag for United States of America

asked on

Drop down box and putting an image instead of submit button?

Hello

I have a drop down box with 3 options ,and want put an image instead of submit button so when i click image, a page which is related to (e.g first option )open in another frame,how can i do it?
Thanks
ASKER CERTIFIED SOLUTION
Avatar of webwoman
webwoman

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MOSTAGHASSI

ASKER

hi webwoman

Please let me know how can i relate an option in drop down box to a .html page so when i click image the page open?
Thank you,but you could write 2 lines for me relating options to another pages.
Avatar of webwoman
webwoman

You have to edit this yourself, FrontPage will NOT do any of it for you. And make sure it doesn't try to 'fix' it..

You actually don't even need a button if you don't want one. If you use this...
 <select name="choices" onChange="javascript:window.location.href=document.site.choices.options[document.site.choices.selectedIndex].value">
You'll go to that place when you select something. You need to set the option value to the URL you want to go to.

There are a few ways you can do it using a button. It doesn't even really need to BE a button, it can be just a graphic set as a link. Use an onclick to call a function.

I haven't tested this. It needs to go in the HEAD tags.
<script language="javascript">
function goHere(url) {
url=document.site.choices.options[document.site.choices.selectedIndex].value
window.location.href=url;
}
</script>
where site is the form name, choices is the select name (that applies for the other piece of script too)

And on the image (not a button) you'd use
onclick="goHere('your_url_here')"

I didn't post anything more than what I did because you didn't say WHY you wanted an image button or what you were trying to do. I suspect this is going to be very confusing for you. There's ALWAYS more than one way to do something, and the more detail you can give on what you want to do the better answer you're going to get.

And I'm not sure you are comfortable with editing the code directly -- always a concern for anyone who posts in this topic area.
hi

Yes i'm comfortable for written codes and tomorrow test these codes.

I had another question about using button from flash in frontpage(2 day ago) that was not possible for hyperlink and u answered that i must publish as animated gif ,but now i have to say that it does not work ,i donot have animation in this state but hyperlink is possible,i think there must be a way simple for using button from flash in frontpage.

Thank you
You publish the animated GIF from Flash, not FrontPage. It should be under the SAVE AS option. Once you have a GIF, you use it just like any GIF. Animated or not, it doesn't matter.

You're not going to see ANY animation while you're in FrontPage. NOTHING works while you're in FrontPage, not even FrontPage stuff.

If you're comfortable with codes, you might want to look at other web editors. FrontPage tends to add/change/'fix' things, sometimes conveniently breaking your code.

It's not just FP, all WYSI(N)WYG editors are like that.