Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / JScript / April 2008

Tip: Looking for answers? Try searching our database.

image map and submit form

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RICK - 01 Apr 2008 16:08 GMT
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>
Anthony Jones - 01 Apr 2008 22:58 GMT
> The following will submit a form with a value of "California" for
> lstSelectState.  How can I add another coordinate for say "Iowa" and change
[quoted text clipped - 4 lines]
>   <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>

Signature

Anthony Jones - MVP ASP/ASP.NET


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.