OK, Just a simple fix - function setbox_handler(name, minx, miny, maxx, maxy, redraw) { document.mapserv.imgbox.value = minx + " " + miny + " " + maxx + " " + maxy; document.mapserv.imgxy.value = minx + " " + miny; toFrame();//simply call the function before submit page document.mapserv.submit(); }