ProSoft Technology 5201-104S-103M User Manual

Page 24

Advertising
background image

Web Server

Web Page Construction

Page 24 of 35

ProSoft Technology, Inc.

September 28, 2005

The <SELECT> <OPTION> control can also be used to submit selections from a
drop-down dialog. This control can be used for commands or bit, byte or integer
data. The user selects the option from a drop-down list and the value selected is
passed to the module along with the name parameter. Use of this control can
keep a form from being too cluttered with many small controls.

The browser sends the name/value pairs entered on the form, after the submit
button is selected, to the module and the module processes each received pair.
The module processes the data received on a PUT or POST using the name and
value fields returned from the browser. Values for all valid names will be placed
in the database.

Example code for an HTML form is shown below:

<form method="POST">

<p>Password <input type="password" name="P" size="20"></p>

<p>Control Pump

<input type="radio" value="1" name="B0">On

<input type="radio" name="B0" checked value="0">Off</p>

<p>Contrl Mode&nbsp;

<input type="radio" name="S1" value="0">Off Line&nbsp;

<input type="radio" name="S1" value="1">Local&nbsp;

<input type="radio" name="S1" checked value="2">Remote</p>

<p>Pump Discharge Pressure Setpoint

<input type="text" name="S2" size="10" value="&lt;--DATA 2,1,1,%d --

&gt;"></p>

<p>Flowrate Setpoint

<input type="text" name="S3" size="10" value="&lt;--DATA 3,1,1,%d --

&gt;"></p>

<p><input type="submit"><input type="reset"></p>

</form>

The form area on a Web page for the code above is displayed below:

Note that the value for the two-setpoint parameters on the form will display the
current values from the module's database when the form is loaded. This is
accomplished by using the data insertion tags for the value parameter in each
control. Refer to the next section on the use of data insertion into a Web page.

Advertising