Sideway
output.to from Sideway
Draft for Information Only

Content

HTML Form - 2
   Form Control: <select> element
   Form Control: <textarea> element
   Form Control: <button> element

HTML Form - 2

Form Control: <select> element

The <select> element is the child control element of the <form> element. The <select> element is used to define the menu list control element of a form. Each menu item is held by an <option> element And menu items can also be groupped by the <optgroup> element in a singal hierachical level. There should have at least one item or one <option> element held by the <select> element. 

Code Sample of <select> element with <option> and <optgroup> elements
<form action="http://sideway.hk">
<select name="order">
<option>item a</option>
<option>item b</option>
<optgroup label="Remark">
<option>rem 1</option>
<option>rem 2</option>
<option>rem 3</option>
</optgroup>
</select>
</form>
HTML web page:

Form Control: <textarea> element

The <textarea> element is the child control element of the <form> element. The <textarea> element is used to define the multi-line text input control element of a form. Therefore more text can be entered by the user than an <input> element. And a <textarea> element can also held text content as the initial value

Code Sample of <textarea> element  
<form action="http://sideway.hk">
<textarea name="remarks" cols=30 rows=5>
</textarea>
</form>
HTML web page:

Form Control: <button> element

The <button> element is the child control element of the <form> element. The <button> element is used to define the button control element of a form similar to the buttons created by the <input> element, but the <button> element can hold content for rendering.
The button control type is specified by the attribute 'type' of the <button> element. The possible values of attribute 'type' are "submit", "reset",  and "button". The default value of the attribute 'type' is "submit".
However, the <button> element does not well supported by browsers, it is better to use the <input> element to create button in a form.

Control types of <button> element:

  • The "submit" control 'type' is used to define a submit button in the form. When a submit button is activated, the form data is submitted to the server.

    Code Sample of single "submit" control 'type'
    <form action="http://sideway.hk">
    Input Text: <input type="text" name="txtinput"><br>
    <button  name="submit" type="submit" >
    <img src="../../../../../../../../images/arrowlt.gif"> Submit
    </button>
    </form>
    HTML web page:
    Input Text:
  • The "reset" control 'type' is used to define a reset button in the form. When a reset button is activated, all form controls are reset to their initial values.

    Code Sample of single "submit" control 'type'
    <form action="http://sideway.hk">
    Input Text: <input type="text" name="txtinput"><br>
    <button  name="reset" type="reset">
    Reset <img src="../../../../../../../../images/arrowrt.gif">
    </button>
    <button type="submit" >
    <img src="../../../../../../../../images/arrowlt.gif"> Submit
    </button>
    </form>
    HTML web page:
    Input Text:
  • The "button" control 'type' is used to define a push button in the form. A clickable button is created with no default function like other specific functional button. However, the 'event' attributes of each clickable button can be used to activate the associated clinet-side scripts when the event of the button to trigger

    Code Sample of "button" control 'type'
    <form action="http://sideway.hk">
    <button  name="button" type="button" >
    press to open a new window <img src="../../../../../../../../images/arrowup.gif">
    </button>
    </form>
    HTML web page:

©sideway

ID: 110400002 Last Updated: 4/4/2011 Revision: 0 Ref:

close

References

  1. http://www.w3.org/TR/1999/REC-html401-1999, 1999, HTML 4.01 Specification: W3C Recommendation, updated 24 December 1999
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019