Javascript, queries, and frames

Rebecca Colwell colwell at GEOG.UMN.EDU
Tue Sep 14 17:02:35 EDT 2004


Hi all,

I'm trying to query my map and have the resulting information appear in
a frame in the right hand side column of a table.  I've been reading
past listserv responses for a week and haven't found the answer I'm
looking for.  I've provided the code I think corresponds with my problem
below.

I don't know a few things that I would love to get some feedback on.
1.) Does the javascript I have look right?
2.) What code do I need to have in my "Map Mode" menu (see below) to get
the query results to send to a frame in the main map html?
3.) Can a frame exist in an html document as a stand alone frame?  For
instance, I would like the query info to display in the white space
below my legend.  The legend exists within a table column and I've
placed the frameset code below the legend.

If you see any other glaring errors in my logic, please feel free to
point it out.

Thank you,

~Becky


For the javascript code, I have the following:

//Checks Target
function CheckTarget(){
if (document.mapserv.mode.value == "query"){
document.mapserv.target="QueryResults";}
else{
document.mapserv.target="";
}
}

At the beginning of my form I have:

<form name="mapserv" method="GET" action="/cgi-bin/mapserv"
onSubmit="CheckTarget();" target="QueryResults">

In my Map Mode dropdown menu I have:

Map Mode:<br>
        <select name="mode">
        <option value="browse">Browse</option>
        <option value="map">Map</option>
        <option value="query" [query_select]>Query Single Layer</option>
         <option value="query" [mode_query_select]> Query State Info
        </select>

My frame code:

<frameset cols="214">                                                                   <frame name="QueryResults"
src="templates/frame1.html" noresize>
</frameset>



More information about the mapserver-users mailing list