Javascript, queries, and frames
Rebecca Colwell
colwell at GEOG.UMN.EDU
Fri Sep 17 11:50:19 PDT 2004
Hi all,
Many thanks to Brant and Tyler for their input on my problem. :D
The solution that got me up and running was to create a frame.html doc
with two frames. The key for making it work in the end was to name the
frame I wanted to direct query results in the frame.html doc.
<FRAMESET ROWS="79%,*">
<FRAME
SRC="http://mapserver.geog.umn.edu/cgi-bin/mapserv?map=/home/name/public_html/Mapdoc/Map1.map&mode=browse">
<frame name="QueryResults" src="templates/frame1.html" noresize>
</FRAMESET>
Thanx again!
~Becky
Brant Anderson wrote:
> Hi Rebecca,
>
> I'll try to help you the best I can... But no promises. ;-)
>
> I haven't worked with targeted forms at all, but in theory, your code
> looks pretty good. As far as your "frame code" goes, I think you need
> two frames in the frameset. For example:
> <frameset cols="214">
> <frame name="MapFrame" src="templates/frame0.html"> <!-- this frame
> is your main application frame -->
> <frame name="QueryResults" src="templates/frame1.html" noresize> <!--
> this frame is used for your query results -->
> </frameset>
>
> You'll most likely need to modify my "persay" frameset page to make the
> page look how you want it. The main point is that you will need two
> frames in the frameset.
>
> Could you give an example of how the page is acting with your current
> code? Have you taken a look at the Itasca demo? It uses frames, but it's
> done in a different way using JavaScript to pull the information from
> MapServer, instead of assigning a target frame.
>
> Hope I was helpful!
>
> Brant
>
>
>
>
> 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