Javascript, queries, and frames

Tyler Mitchell tylermitchell at SHAW.CA
Tue Sep 14 19:18:52 PDT 2004


Hi Rebecca, it's been a while since I tackled the frames issue, but you can
see it in action at:
http://www.mapitout.com/restaurants

The query function displays a photo in the left frame.

Hope that helps.
Tyler
On September 14, 2004 02:02 pm, Rebecca Colwell wrote:
> 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