Click to See Complete Forum and Search --> : Help with ISMAP form


pastorken
04-14-2006, 03:22 AM
I currently run a web site that uses a standard html type form to allow search of the mysql db

Typical set up
<FORM METHOD="POST" ACTION="returnlist.php">
<INPUT TYPE="HIDDEN" NAME="sort_by" VALUE="0">
<INPUT TYPE="HIDDEN" NAME="exact_match">
<SELECT NAME="CITY">
<OPTION VALUE="STATE">Texas</OPTION>
<INPUT TYPE="SUBMIT" VALUE="Submit Search"></FORM>

This results in a display of all Texas listlings on the db.

I want to use a FLASH US map.swf that is displayed with a common javascript enabled ISMAP to allow a person to mouseover the state and click to see the state listings.

Thus in the polygon's HREF field, what javascripting is needed to
load the variables and using onClick submit the form passing those variables properly?

The ismap is formulated like this
<script type="text/javascript">
<!--

function getImageMapXXXXXXX()
{

document.writeln('<map name="XXXXXXX" id="XXXXXX"><area shape="poly" coords="113,275,113,289,127,289,127,275,113,275" href="http://domainname.com/returnlist.php?sort_by=0?exact_match?state=HI"/>

How can I embed a javacript to handle the form sending of the variables ???

you answer will be most gratefully accepted.

ken

phpnovice
04-14-2006, 11:11 AM
The only place I've seen isMap (http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/ismap.asp) used is on the IMG tag -- and no FORM is involved at all. Such an IMG, with the isMap attribute, automatically becomes clickable and, when clicked, the page is "submitted" to itself as if a <FORM METHOD="GET"> submission had occurred. However, with this submission, it is not name/value pairs which are attached to the URL of the current page -- it is just the raw, comma-delimited coordinates where the image was clicked. Thus, if the page represeted a server-side code document, such server-side code would have ready access to the clicked coordinates as raw data. JavaScript, too, has access to this data (self.location.search) -- but JavaScript may be disabled while server-side code will keep right on executing.