[Mapserver-users] jBox & onSubmit()

Steve McCrone ms57 at streamyx.com
Thu Jan 29 23:03:38 PST 2004


jBox & onSubmit()

I have included the jBox applet and implemented zoom, pan and info.
I wish to open my query results in a separate window, and to do this I need
to have a javascript function (see below). I wish to call this function
toFrame() when the page gets submitted. Therefore, I have  -

<form method="GET" action="[program]" name="mapserv" onSubmit="toFrame()">

But, the toFrame() only gets called when the Refresh button gets pushed
(i.e.<input type="submit" value="Refresh/Query">).
Even though in the setbox_handler() (after zoom-in, for example) I do have a
submit statement, the toFrame() does not get called, even though it appears
the page is being submitted.

Thanks

 function setbox_handler(name, minx, miny, maxx, maxy, redraw) {
  document.mapserv.imgbox.value = minx + " " + miny + " " + maxx + " " +
maxy;
  document.mapserv.imgxy.value = minx + " " + miny;
  document.mapserv.submit();
 }


 function toFrame() {
   alert("hi")
   if (document.mapserv.mode.value == "query" || document.mapserv.mode.value
== "nquery") {
     document.mapserv.target = "querywindow";
   } else {
     document.mapserv.target = "_self";
   }
 }




More information about the MapServer-users mailing list