Return to the MildServer page
Continue to the MildServer/HTTPRequest page
HTMLInput Utilities
The file Utils\HTMLInput.dyalog contains the HTMLInput namespace, which contains utility functions which are used by all the examples. All the classes defined in the Utils folder are defined in the server workspace before the application starts. The easiest way to use these functions in your pages is to make sure your class source contains the following line:
:Include #.HTMLInput
The functions in the HTMLInput namespace are described in the following. In each case, the function name is bold, optional parameters are italic. Most functions take a name on the left and define both the id and name attributes to have this value. Where present, the parameter called attributes allows you to insert any additional attributes that you wish.
Function Reference
name Button value attributes
A button. Unless you are using JavaScript events to react to pressing the button, you should probably use the Submit function instead of Button. value is the text to be displayed. When values are posted, a parameter with the name of the button will be reported as having this value. A common technique is to give all your buttons the same name and use the reported value to determine which button was pressed.
name CheckBox checked attributes
Defines an HTML input with type=checkbox, which is either checked or unchecked. For example:
'Check1' CheckBox 1 'style="color: blue;"' <input style="color: blue;" type=checkbox name=Check1 checked=1>
name DropDown items value attributes sort
Defines a dropdown or combo box. items is the list of values to go in the list. value is the currently selected value. sort causes items to be sorted before they are inserted into the list.
name Edit value size attributes
Generates a "normal" Edit or Input field. value is the data to insert into the field. size is the size.
tag Enclose html
Encloses arbitrary HTML in a tag. For example:
'a href="http://www.dyalog.com"' Enclose 'Dyalog' <a href="http://www.dyalog.com">Dyalog</a>
name File size value attributes
Generates an Input field which can be used to upload a file. size is the size of the field, value is the data to initialize the field with. Note that the value that is reported for this kind of field is a two-element vector: The file name and the data content of the file.
attributes (method Form) innerhtml
Form is actually a user-defined operator: method can be either post or submit. The right argument is simply some HTML which is to be embedded in the input form.
name Hidden value attributes
Generates an invisible Input field with the defined value. The user cannot see or change the content of this field, but it will be posted back to the server, so it is a way to store data between requests. The contents can also be seen by client-side code (JavaScript).
JS script
Embeds javascript.
name MultiEdit rowscols values attributes
Generates a multi-row Edit or Input field. rowscols gives the size. values is the data to insert into the field.
name Password size value attributes
An input field for entering input which should not be displayed as it is typed. value is the data to insert into the field. size is the size.
name RadioButton checked value attributes
Defines an HTML input with type=radio, which is either checked or unchecked. The label is given by value.
name Submit value attributes
A button which will submit the form that it is inside. value is the text to be displayed. When values are posted, a parameter with the name of the button will be reported as having this value. A common technique is to give all your buttons the same name and use the reported value to determine which button was pressed.
name Table data table_atts cell_atts header_atts header_rows
Wraps a matrix as an HTML table. The optional arguments are:
table_atts |
Attributes for the table element |
cell_atts |
Attributes for td elements |
header_atts |
Attributes for header rows |
header_rows |
Indices of header rows |
Return to the MildServer page
Continue to the MildServer/HTTPRequest page