Page 125 - DCAP512_WAP_AND_WML
P. 125
Unit 9: Working with user Input
</card> Notes
<card id =”card2">
<p>
var1 set
</p>
</card>
</wml>
Getting User Input
Entry fields <input> are used to collect information from the user in the form of text fields.
Selection lists <select> are used to give users a choice of several predetermined answers in the
form of radio buttons or check boxes.
Task Analyze what is the Input tag used for? What are its attributes?
Self Assessment
Fill in the blanks:
1. If variable data is not drawn from an earlier card or a ……………………., the initial value
must be set.
2. ……………………. effectively creates a card that is never seen by the user but can be used
by the browser.
3. Variable escaping is typically used within …………………….
4. ……………………. can also be set through an input element.
5. Entry fields ……………………. are used to collect information from the user in the form of
text fields.
9.2 Free form Input with <input>
The <input> entry fields collect information from the user in the form of text fields. Attributes
are listed in Table 9.2.
Table 9.2
Name Identifies the name of the variable in which the user input is to be used
Value Supplies the default value
Format Specifies an input mask for the input
Size Sets the desired display width
Maxlength Sets the maximum number of chars. allowed
Type Default is “text” but can be “password”
EmptyOK Indicates whether or not an empty string is valid, the default is “false” or no.
LOVELY PROFESSIONAL UNIVERSITY 119