# User Input
Updated: 9/28/2020, 10:32:47 PM
Created: 9/28/2020, 10:32:47 PM
Last Updated By: Peter Schellenbach
Read Time: 3 minute(s)
This feature is very similar to adding links to a widget; however, unlike the links feature, this allows the user the ability to select or specify values.
There are five types of user input available:
- The user may fill in a text field. (W$INPUT.TYPE = "TEXT")
- The user may fill in a password field (W$INPUT.TYPE = "PASSWORD"), which behaves the same as text field input except that the typed characters are obfuscated by dots.
- The user may select a value from a list of predetermined values. (W$INPUT.TYPE = "SELECT")
- The user may select a date from a date picker pop-up: (W$INPUT.TYPE = “DATE”)
- The user may select or deselect a check box (W$INPUT.TYPE = "CHECKBOX") which sets WIDGET.USER.DATA() to "1" if selected or "0" if deselected. Note that the initial value will be "" and will not become "0" unless and until it has been deselected after being previously selected, and therefore should be evaluated as being equal to "1" or not equal to "1".
Each of the values listed below may contain multiple attributes in order to generate multiple input prompts. When the submit button is clicked, all input data values will be assigned to the prescribed WIDGET.USER.DATA element(s) prior to running the widget on the next page load. Input prompts are defined by populating the following variables:
When the user submits the form (clicks the "Go" button), the global variable G$SUBMITTED will be set to "1" when the widget subroutine is executed.
|W$INPUT.PROMPT||The prompt text associated with this input|
|W$INPUT.TYPE||“TEXT”, “PASSWORD”, “SELECT”, “DATE” or “CHECKBOX”|
|W$INPUT.SELOPTS||For SELECT type, this is a value-mark-delimited list of selection options presented to the user in a drop-down list.|
|W$INPUT.SELVALS||For SELECT type, this is a value-mark-delimited list of values associated with the options provided. The user does not see these values.|
|W$INPUT.DEFAULT||The default value to be displayed to the user. For SELECT type, this should be the value data, not the option text.|
|W$INPUT.UDPOS||The element of the WIDGET.USER.DATA array in which the user’s input/selection will be stored.|
|W$INPUT.PARAMS||If specified, this string is added as an attribute to the <input> or <select> HTML tag. Multiple attributes for a single tag must be separated by spaces (For example: W$INPUT.PARAMS<1,1>=\size=30 maxlength=20 style="color:white;background-color:red") creates a text box with a red background that is sized at 30% of the available width. A maximum of 20 white characters are allowed.|
|W$INPUT.PROMPT.PARAMS||If specified, this string is used to style the prompt text specified in the W\arccos$INPUT.PROMPT string in the same way that the W$INPUT.PARAMS string is used to style the actual field itself.|
|W$INPUT.BUTTON||The name of the submit button. If not specified, "Go" will be used. This is only a single value – only one button is present to submit all input fields for any widget.|