##
Sending Variables

In
a small extension has been added to "helloworld.html".It shows how to specify MapServer CGI variables
and projection parameters.
There are only two additions to "helloworld.html": a number of input fields for the map parameters, and the conversion of these input fields to CGI variables in the submit function The main thing to understand here is the way in which values from HTML elements are transferred to JavaScript variables. This is done by assigning an "id" to each HTML element, and accessing the element by the JavaScript DOM function

    document.getElementById()

This function returns the unique element created with the specified id. All input fields in the projection input table have unique ids, so they can be used in creating the projection string. This string is then put in a single setVar() call, with "map_projection" as first parameter.
There are two functions to retrieve multiple elements:

    document.getElementsByTagName()
    document.getElementsByName()

Both return an array of HTML elements. "getElementsByTagName()" returns all elements from a predefined HTML class, like <img>. "getElementsByName()" returns all elements that have been created in the HTML file with the same user defined "name" tag. In the table with CGI variables I named all input fields either "ms_name" or "ms_value", so that in the submitWin function I could retrieve them with a simple loop into two arrays.
Lists of all MapServer variables can be found in the
and
Reference Guides. A summary of all supported projections and their parameters can be got from the
site, and by running PROJ standalone with the -lP flag.