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

Advance Search turn to Map search please help...

Status
Not open for further replies.

ott27

Programmer
Jan 13, 2004
4
US
Hi all,

I need some help with this scenerio... I have an advance search that is searching by states like this below....

<form name="form1" method="get" action="results_list.php" onSubmit="return validatestate()">
<input type="hidden" name="statename" value="">
<select name="state" size="1">
<option selected>Select State/Province</option>
<optgroup label="USA">
<option value="AK">Alaska</option>
<option value="AL">Alabama</option>
<option value="AR">Arkansas</option>
<option value="AZ">Arizona</option>
<option value="CA">California</option>
<option value="CO">Colorado</option>
<option value="CT">Connecticut</option>
<option value="DC">District of Columbia</option>
<option value="DE">Delaware</option>
and so on.....

And now I would like to use a U.S. map (image map) and have the ability to click each states to return the results_list.php, I have something similar below but not sure how to link the two together. Here it is....

<table align="center" width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td colspan="2"><img src="us.gif" border="0" usemap="#usmap" class="mapBorder" /></td>
</tr>
<tr>
<td>
<map name="usmap">
<area alt="" shape="rect" coords="499,187,531,204" href="javascript:void(0)" onclick="window.open('/area_code_maps/display.html?dc','','width=550,height=400,scrollbars=yes,resizable=yes');" />

I'm not sure what this section should be the bold and italic code. For this example it's wanting to open up a new windows for the Distric of Columbia area. All I would want to do is have results_list.php take care of it.

Any help?? Thanks in advance.
 
Just loose the Javascript there, and use the href attribute of the map area to set the page to results_list.php

Code:
<map name="usmap">
<area alt="" shape="rect" coords="499,187,531,204" [red]href="results_list.php?state=AK"[/red]/>

Thner from within results_list.php use $_GET['state'] to get the value of the sate that was clicked on.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Thank you for your suggestions, I will give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top