<form>

The <form> element acts as container for controls elements.

Contents

A combination of one element <input type=”submit”> and

  • one or more of the following elements: <input>, <select>, <br>, <p>
  • or one single <textarea> element
Attributesattributes

values

(Default are bolded)

description
actionURL

Specifies a form processing agent. User agent behavior for a value other than an
HTTP URL is undefined. Refer to [5] for correct URL format.

methodget

Specifies the HTTP method used to send the form to the processing agent. Only get
method is supported in XHTML-GP.


<input>

The <input> element represents editable area

Contents

Empty

Attributesattributes

values

(Default are bolded)

description
type

text
password
checkbox
radio
submit
hidden

Specifies the type of control to create.

nametext

Assigns name to the control. Not used for type=”submit”. Some names are reserved for Gigaset systems (see [5]).

valuetext

Specifies the initial value of the control. Mandatory for type=”radio” and type=”checkbox”.

disableddisabled

When set for a form control, this Boolean attribute disables the control for user input.

checkedchecked

Specifies the state of a button. Valid for type=”radio” and type=”checkbox”.

inputmode

text
digits
dialpad

Specifies appropriate input mode for the text input expected in an associated input control.
Possible values means:

text: all available characters

digits: digits only: 0…9

dialpad: dial characters: 0…9 and #, *, P, R

maxlength1..32

Specifies the maximum number of editable characters. Valid for type="text" and type="password"

Example:

<body>

<form action="http://host.com/adddata" method="get">

<p>text description</p>

<p>Text: <input type="text" name="input1" maxlength="12" value="default" /></p>
<p>Password: <input type="password" name="input2" maxlength="12" /></p>
<p>Checkmark <input type="checkbox" name="c1" checked="checked" value="check 1" /></p>
<p>Radio 1 <input type="radio" name="r1" checked="checked" value="option 1" /></p>
<p>Radio 2 <input type="radio" name="r1" value="option 2" /></p>
<p><input type="submit" value="Send"/></p>

</form>

</body>


<select>

The <select> element indicates list with options.

Contents

One or more of the following elements: <option>

Attributesattributes

values

(Default are bolded)

description
disableddisabled

When set for a form control, this boolean attribute disables the control for user input.

nametext

Assigns a name to the control.

Example:

<body>

<form action="http://host.com/adddata" method="get">

<p>Color:

<select name="colors">

<option value="1">red</option>

<option value="2" selected="selected">green</option>

<option value="3">blue</option>

</select>

</p>

<input type="submit" value="Submit"/>

</form>
</body>


<option>

The <option> element represents choice of menu created by <select>

Contents

One or more of the following elements: text

Attributesattributes

values

(Default are bolded)

description
valuetext

Specifies initial value to the control.

selectedselected

When set, this boolean attribute specifies that this option is pre-selected

.


<textarea>

Element allows the creation of a multiline text window for textual user input.

Contents

One or more of the following elements: text

Attributesattributes

values

(Default are bolded)

description
nametext

An attribute used to assign a variable name to a form control. The name should be unique within the document

Example:

<body>

<form method="get" action="edit_result.jsp">
<textarea name="s1">
The quick brown fox jumps over the lazy dog.
</textarea>
<input type="submit" value="Search"/>
</form>

</body>



  • No labels