WML » Tags » input

<input ... />

The input tag is used to collect text or password information that is entered into the browser by the user. The input element will display an input field, which upon being selected, opens a text editing window in which the user can enter the requested information.

If valid, the value entered by the user will be assigned to the variable named in the mandatory name attribute. An invalid entry will not be accepted by the browser.

Validity is based upon the input mask set by the optional format attribute. An input mask dictates which alphanumeric and punctuation characters can be entered into the input element and the order that they must be entered. For example, if the input mask specifies only numeric characters [0-9], then the text typed by the user cannot contain any other type of characters. The default is to accept essentially any number of any type of characters (but all characters are treated as uppercase for date entry). Note that the emptyok attribute will permit an empty entry even if an input mask is in place.
The characters in the password string are usually displayed on the monitor as a series of asterisks. However, a password input is not secure.
In WML, there is no equivalent to the form tag in HTML. However, you can use fieldset elements to group related input elements.
This is a self-closing tag.
Nested Tags:  None


<?xml version="1.0"?>
<card id="card1" title="Card 1">
First Name: <input id="inp1" type="text" name="firstname" format="M*m" /><br />
Last Name: <input id="inp2" type="text" name="lastname" format="M*m" /><br />
Age: <input id="inp3" type="text" name="age" format="*N" maxlength="3" emptyok="true" /><br />
Street: <input id="inp4" type="text" name="street" /><br />
City: <input id="inp5" type="text" name="city" /><br />
State: <input id="inp6" type="text" name="state" format="MM" /><br />
Zip: <input id="inp7" type="text" name="state" format="5N" /><br />

This code demonstrates how to use the input tag for information collection.

Language(s): WML

See Also: