<form> .............. input element </form>
HTML Forms - The Input Element
The most important form element is the <input> element. The <input> element is used to select user information. An <input> element can vary in many ways, depending on the type attribute. An <input> element can be of type text field, checkbox, password, radio button, submit button, and more. The most common input types are described below.HTML Form usually used along with the input. While the input itself is the command used to fill the input from the user. Elements of the input is:
1. Text, used to fill in a value can be text or numbers.
2. Radio, stuffing elements such option where only one option is to do.
3. Checkbox, elements that provide multiple choices could be more than one.
4. List, the element of choice in the form of a list.
5. Button, elements such as buttons to perform a process.
6. Submit, the key element that is used to call the url.
7. Reset, the key element that is used to restore the initial conditions.
8. Image, is used instead of buttons, is an image that can perform the process.
9. Textarea, the element that can hold a collection of typed text from the user.
10. File, which can call a button element or an image file from storage.
11. Passwords, text-specific elements are used for a password.
List of attributes form
Attribute
|
Description
|
action
|
handling form
|
method
|
[get | post] method to submit the form
|
enctype
|
String value, content type submit form
|
target
|
String value, target the frame
|
onSubmit
|
String value, which has been in the form submit
|
onReset
|
String value, the form that has been reset |
Name
|
Giving the name of the form |
List the attributes that accompany the input element
Attribute
|
Description
|
type
|
Hold the value / name of the element.
|
name
|
String value, key in the form submit
|
value
|
String value of the input
|
checked
|
The value of a radio button or checkbox element
|
size
|
Integer value, determine the length of text element
|
maxlength
|
Integer value, determine the length of the text.
|
src
|
Location URL or image
|
alt
|
String value, captions for pictures
|
readonly
|
Prevent changes
|
accept
|
String value, media to upload file
|
acecckey
|
String value, for shortcut keys
|
tabindex
|
Integer value, determine the position of the tab
|
onfocus
|
String value, the element that receives the cursor
|
onblur
|
String value, elements of the left cursor
|
onselect
|
String value, selected text
|
onchange
|
String value, the value will be replaced
|
onclick
|
String value, the process if button is pressed
|
Select is the command used to create a list of options along with the command options. Eg choice of work, personal status.
Attribute on the command "Select"
Attribute
|
Description
|
name
|
String value, key in the form submit
|
multiple
|
To create a multiple-choice
|
size
|
Integer value, determine the number of items that appear
|
disable
|
To hide elements
|
tabindex
|
Integer value, determine the position of the tab
|
onfocus
|
String value, the element receiving text cursor |
onblur
|
String value, elements of text cursor left |
onchange
|
String value, the value will be replaced |
Attributes on the "option"
Atribut
|
Keterangan
|
value
|
String value, the value of options
|
selected
|
A choice of initial
|
disabled
|
Hiding choice
|
label
|
String value, the choice of label
|
The following is an example of an HTML form
<HTML><head><title> HTML Form </title></head><form name="student" method=post action="student_list.php"><h2><center>WELCOME NEW STUDENT</CENTER></H2><fieldset><legend><b>Biodata prospective students</b></legend><table><tr><td><label for="noreg">No. Registration :</label></td><td><input type="text" name="noreg" maxlength=5 size=6></td></tr><tr><td><label for="name">Name :</label></td><td><input type="text" name="name" maxlength="45" size="47"></td></tr><tr><td><label for="add">Address :</label></td><td><textarea name="add" rows="5" cols="30"></textarea></td></tr></table></fieldset><br><fieldset><legend><b>Registration data</b></legend><table><tr><td><label for=jur1>Choice Programs :</label></td><td><select name="choice"><option value="is">Information Systems</option><option value="ie">Informatics Engineering</option><option value="im">Information Management</option></select></td></tr><tr><td><label for=alm>Study of Education :</label></td><td><input type="radio" checked name="se">S1</input><input type="radio" name="se">D3</input></td></tr><tr><td><label for=fee>Registration Fee :</label></td><td><input type="text" name="fee" maxlength=7 size=8></td></tr><tr><td><label for=alm>Elective courses:</label></td><td><input type="radio" checked name="prog">Reguler</input><input type="radio" name="prog">Extension</input></td></tr></table></fieldset><br><center><input type="submit" value="Send"><input type="reset" value="Reset"></center></form></HTML>
0 comments
Post a Comment