- WML Tutorial
- WML - Home
- WML - Overview
- WML - Environment
- WML - Syntax
- WML - Elements
- WML - Comments
- WML - Variables
- WML - Formatting
- WML - Fonts
- WML - Images
- WML - Tables
- WML - Links
- WML - Tasks
- WML - Inputs
- WML - Submit Data
- WML - Server Scripts
- WML - Events
- WML - Timer
- WML - Template
- WML - DTD
- WML2 - Tutorial
- WML References
- WML - Entities
- WML - Tags Reference
- WML Tools
- WAP - Emulators
- WML - Validator
- WML Useful Resources
- WML - Quick Guide
- WML - Useful Resources
- WML - Discussion
true
false
text
password
WML <input> Tag
The <input/> element is used to create input fields and input fields are used to obtain alphanumeric data from users.
Attributes:
This element supports the following attributes:
Attribute | Value | Description |
---|---|---|
name | text | The name of the variable that is set with the result of the user's input |
maxlength | number | Sets the maximum number of characters the user can enter in the field |
emptyok | Sets whether the user can leave the input field blank or not. Default is "false" | |
format | A a N X x M m *f nf |
Sets the data format for the input field. Default is "*M".
A = uppercase alphabetic or punctuation characters |
size | number | Sets the width of the input field |
tabindex | number | Sets the tabbing position for the select element |
title | text | Sets a title for the list |
type | Indicates the type of the input field. The default value is "text". Password field is used to take password for authentication purpose. | |
value | text | Sets the default value of the variable in the "name" attribute |
xml:lang | language_code | Sets the language used in the element |
class | class data | Sets a class name for the element. |
id | element ID | A unique ID for the element. |
Example:
Following is the example showing usage of this element.
<?xml version="1.0"?> <!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN" "http://www.wapforum.org/DTD/wml12.dtd"> <wml> <card title="Input Fields"> <p> Enter Following Information:<br/> Name: <input name="name" size="12"/> Age : <input name="age" size="12" format="*N"/> Sex : <input name="sex" size="12"/> </p> </card> </wml>
This will provide you the following screen to enter required information:
To Continue Learning Please Login
Login with Google