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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with imagemap form--won't submit OnClick 1

Status
Not open for further replies.

presumpscot

Technical User
Dec 5, 2000
2
US
I'm can't get an imagemap form to submit when the user clicks on a hotspot. It will work in IE 5.5 using DblClick, but in all other cases it doesn't execute. No errors, just nothing happens. The test page is at
See the source code for detailed comments.

Code in question is:

onClick="window.document.mapsearch.submit();"

Thanks for the help!
 
I think it is a bizarre problem with your href, watch what happens if you change it to look like this:

<MAP NAME=&quot;searchablemap&quot;>
<AREA COORDS=&quot;1,0,48,25&quot; ALT=&quot;Falmouth&quot; SHAPE=&quot;rect&quot;
HREF=&quot;javascript:getsearchresults();&quot;
onMouseover=&quot;document.forms.mapsearch.lookfor.value = 'Falmouth';
return false;&quot;
>


<AREA COORDS=&quot;2,26,48,50&quot; ALT=&quot;Rockland&quot; SHAPE=&quot;rect&quot;
HREF=&quot;javascript:getsearchresults();&quot;
onMouseover=&quot;document.forms.mapsearch.lookfor.value = 'Rockland';
return false;&quot;
>

</MAP>

just put your onclick behavior in the href, and get rid of the onclick...not sure why this worked,but it does jared@aauser.com
 
Jared,

May your life be filled with much happiness and good fortune.

Thank you, thank you, and thank you again for a simple, elegant, and thoroughly effective solution. I followed your suggestion and tested it in IE 5.5, NS 6, 4.7, 3, and 2. It worked beautifully in all but NS 2--which I presume is simply because NS 2 is from the Jurassic Age of JavaScript and doesn't support some of that code.

Now that you've helped me iron out the last kink in my test page, I can go ahead and implemement the real McCoy.

Muchas gracias

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top