21.2. Submit Buttons in XHTML MP

In XHTML MP, every form should contain one submit button. The form data is sent to the server when the submit button is pressed. If you are familiar with WML, you should know that data posting is done with anchor links in WML. This is not possible in XHTML MP.

The <input> element is used to create a submit button in XHTML MP. The type attribute should be specified as "submit", like this:

<input type="submit"/>

A submit button's caption is "Submit" by default. The value attribute is used to change a button's caption. The following XHTML MP markup changes the button's caption to "OK".

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

21.3. Reset Buttons in XHTML MP

When a reset button is pressed, the form that contains the reset button is set to the initial state. A reset button is not a compulsory component of a form in XHTML MP.

Like submit buttons, the <input> element is used to create a reset button. Reset buttons are of the type "reset".

<input type="reset"/>

A reset button's caption is "Reset" by default. Like submit buttons, a reset button's caption can be modified. The value attribute is used to do this. For example, the following XHTML MP markup creates a reset button with the caption "Default".

<input type="reset" value="Default"/>

Previous Page Page 35 of 36 Next Page

Feedback Form (Expand)

What do you think about this web page?