|
|
|
date: Tue, 1 Apr 2008 08:08:03 -0700,
group: microsoft.public.dotnet.languages.jscript
back
image map and submit form
The following will submit a form with a value of "California" for
lstSelectState. How can I add another coordinate for say "Iowa" and change
lstSelectState's value to "Iowa"
<form name="form1" method="post" action="CPC_NCList_Alpha.asp">
<input type="hidden" name="hdnRequestType" value="State">
<map name="Mappings">
<area shape="poly"
coords="9,64,37,74,30,98,58,143,62,153,55,165,38,166,29,151,12,141,10,124,9,112,4,94,3,80,8,65" href="javascript:document.form1.submit()" target="_top">
</map>
<input type="hidden" name="lstSelectState" value="California">
</form>
date: Tue, 1 Apr 2008 08:08:03 -0700
author: RICK
Re: image map and submit form
"RICK" wrote in message
news:6C7959AD-CE4F-48A0-9E13-511367631786@microsoft.com...
> The following will submit a form with a value of "California" for
> lstSelectState. How can I add another coordinate for say "Iowa" and
change
> lstSelectState's value to "Iowa"
>
> <form name="form1" method="post" action="CPC_NCList_Alpha.asp">
> <input type="hidden" name="hdnRequestType" value="State">
> <map name="Mappings">
> <area shape="poly"
>
coords="9,64,37,74,30,98,58,143,62,153,55,165,38,166,29,151,12,141,10,124,9,
112,4,94,3,80,8,65" href="javascript:document.form1.submit()" target="_top">
> </map>
> <input type="hidden" name="lstSelectState" value="California">
> </form>
I've never used an image mapp before but my guess at what you need is:-
<script type="text/javascript">
function mappings_onclick(ev)
{
var area = ev ? ev.target : event.srcElement
document.form1.lstSelectState.value = area.getAttribute("state");
document.form1.submit();
}
</script>
<form name="form1" method="post" action="CPC_NCList_Alpha.asp">
<input type="hidden" name="hdnRequestType" value="State">
<map name="Mappings"
onclick="mappings_onclick.apply(this, arguments)">
<area shape="poly"
coords="9,64,37,74,30,98,58,143,62,153,55,165,38,166,29,151,12,141,10,124,9,
112,4,94,3,80,8,65"
href="javascript:void(0)" state="California">
<area shape="poly"
coords="Iowa coords here"
href="javascript:void(0)" state="Iowa">
</map>
<input type="hidden" name="lstSelectState">
</form>
--
Anthony Jones - MVP ASP/ASP.NET
date: Tue, 1 Apr 2008 22:58:27 +0100
author: Anthony Jones
|
|