MapTools.org

[rosa-users] Re: [mapserver-users] JavaScript / ROSA ... Accessing data before submit

Yewondwossen Assefa assefa@dmsolutions.ca
Thu, 26 Sep 2002 16:25:09 -0400
I have just done a similar try here :

.....
  printf("<PARAM NAME=\"INP_COORD_NAME\" VALUE=\"INPUT_COORD\">\n");
.....


 printf("<PARAM NAME=\"TB_BUT_test_IMG\"
VALUE=\"./images/tool_ruler_1.gif\">\n");
 printf("<PARAM NAME=\"TB_BUT_test_IMG_PR\"
VALUE=\"./images/tool_ruler_2.gif\">\n");
 printf("<PARAM NAME=\"TB_BUT_test_HINT\" VALUE=\"Draw lines on the map\">\n");
 printf("<PARAM NAME=\"TB_BUT_test_INPUT\" VALUE=\"auto_poly\">\n");
 printf("<PARAM NAME=\"TB_BUT_test_NAME\" VALUE=\"CMD\">\n");
 printf("<PARAM NAME=\"TB_BUT_test_VALUE\" VALUE=\"\">\n");
  printf("<PARAM NAME=\"TB_BUT_test_JSACTION\" VALUE=\"AlertCoord()\">\n");


 with Js function AlertCoord defined :

function AlertCoord()
{
  szCoord = document.forms[0].INPUT_COORD.value;
  window.alert(szCoord);
}


And as soon as the drawing is done, I have a window poping up with the correct
coordinates.

I did not see anything wrong with the setting that you have given, and the
INPUT_COORD should be set if properly defined.

Later,

"Hankley, Chip" wrote:

> I'm confused about the TB_BUT_?_JSACTION function works in ROSA. Here's part
> of my Applet definition:
>
>     <PARAM NAME="TB_BUT_redline_IMG"
> VALUE="/MapSymbols/NavSymbols/RedLineOff.GIF">
>     <PARAM NAME="TB_BUT_redline_IMG_PR"
> VALUE="/MapSymbols/NavSymbols/RedLineHv.GIF">
>     <PARAM NAME="TB_BUT_redline_CURSOR_TYPE" VALUE="CROSSHAIR">
>     <PARAM NAME="TB_BUT_redline_HINT" VALUE="Sketch on the Map">
>     <PARAM NAME="TB_BUT_redline_INPUT" VALUE="auto_poly">
>     <PARAM NAME="TB_BUT_redline_JSACTION" VALUE="myJSFunction()">
> #JavaScript Line
>     <PARAM NAME="TB_BUT_redline_NAME" VALUE="CMD">
>     <PARAM NAME="TB_BUT_redline_VALUE" VALUE="REDLINE">
>
> If I DIDN'T include the JavaScript line, this button would allow the user to
> digitize a polyline on the map, and the coordinates would be submitted with
> the form, in a variable called INPUT_COORD. If, however, I include the
> JavaScript line as shown, the variable doesn't seem to get set.
>
> What I'm trying to do is set up some client side processes to occur BEFORE I
> submit the form... but I need access to those coordinates. What am I doing
> wrong?
>
> TIA
>
> Chip Hankley

--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa@dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------





This archive was generated by Pipermail.