HTML- form

Form is used to interact, the receiver of the data browser
Syntax: <form name = "" action = "" method = "">
various controls .....
</ form>


Form attribute
name form identifies the
action form data submitted to the processing of data page
method form submission methods are post and get the default get


get manner
by transmitting data address
can not transfer sensitive data
can not transfer a significant amount of data, the maximum 1KB
not pass annex


post way
to pass data to the handler
relatively safe
can transfer large amounts of data
can be transmitted attachments


Controls Introduction


1, single-line text box
Syntax: <input type = "text" name = "" value = "" size = "" maxlength = "" />
Attributes: name line text box identification
size width of the textbox unit characters
up maxlength textbox how many characters can be entered, you can not enter more than
value of the initial value of the text box


2, password box
Syntax: <input type = "password" name = "" value = "" size = "" maxlength = "" />
Properties: identification name password box
initial value value password box
size password box width, unit characters
maxlength character password box up to enter, can not exceed the input
readonly read-only attribute, you can select, you can not modify the
disabled can not be selected and can not be modified


3, single-box
Syntax: <input type = "radio" name = "" value = "" /> value. 1
<INPUT type = "Radio" name = "" value = "" /> 2 Value
Attributes: name Radio button group to identify
the initial value of value of the radio button, must be filled, and different


4, checkbox
Syntax: <input type = "checkbox" name = "" value = "" checked = "checked" /> value. 1
<INPUT type = "CheckBox" name = "" value = "" /> value 2
attributes: name identifies the checkboxes set
value the value of each check box
checked is initially selected by default


5, multi-line text boxes
Syntax: <textarea name = "" rows = "" cols = ""> SUMMARY </ textarea>
Properties: identifies the name multi-line text boxes
rows rows multi-line text boxes
cols up each row The number of characters
initial value content


6, the drop-down list
<SELECT name = "">
<Option value = ""> value. 1 </ Option>
<Option value = ""> value 2 </ Option>
<Option value = ""> value 3 </ option>
</ select>
attributes: name drop-down list identification
value of each of the initial value


7, button
submit button to submit the text on the button form data value
<input type = "submit" value = "" />
Photo form submit button
<input type = "image" src = "" />
Reset button form reset the data to the text on the button initial state value
<input type = "reset" value = "" />
push button itself has no function, the function can be implemented in conjunction with the JS
<input type = "button" value = "" />


8, hidden fields and file upload
hidden fields
Syntax: <input type = name = " " / "hidden">
hidden, in order to transfer data to the program


Upload file
syntax: <input type = "file" name = "" />
Attributes: name of the file upload identify
its value before selecting the file has a value

Guess you like

Origin www.cnblogs.com/arvinzd/p/11322013.html