Forms
A form is an area that can contain form elements.Form elements are elements that allow the user to enter information (like text fields, textarea fields, drop-down menus, radio buttons, checkboxes, etc.) in a form.
forms are used in surveys, on-line order forms, feedback, and send e-mail in general forms are used to inquire inputs from users.
A form is defined with the <form></form> tag.s
<FORM name="name" ACTION="url" method="post/get> >
Form elements
</FORM>
Name is a name given to the form describing its purpose
Action = "url" the url of where the data will be submitted
Method
o GET -- this is the default method and causes the fill-out form contents to be appended to the URL as if they were a normal query.
o POST -- this method causes the fill-out form contents to be sent to the server in a data body rather than as part of the URL.
Form elements
Inside a form are the form's elements like text, input, select, textarea, button, radio buttons and check boxes. Note that you can't insert another form in a form. The INPUT tag is used to add an input element inside a form
form elements
<input type="text" name="UserName" value="">
<input type="password" name="UserPassword" value="">
- submit (a push-button that causes the data from the current form to be sent to a remote server specified by the action attribute (url) .
<input type="submit" name="SendData" value="Send">
Not that the value attribute is the button's caption.
- reset (a push-button that causes the form's element to reset to their original values)
<input type="Reset" name="ResetForm" value="Reset">
- Radio Buttons are used to enable user to select one of a limited number of choices.
<form>
<p>What is your sex?
<input type="radio" name="sex" value="male"> Male
<br>
<input type="radio" name="sex" value="female"> Female
<p>Are you married?
<input type="radio" name="yesno" value="yes"> Yes
<br>
<input type="radio" name="yesno" value="no">No
</form>
Note that each group elements must have the same name to toggle radio buttons of the same group.
- Checkboxes are used to enable the user to select one or more options from number of choices.
<form>
<p>Select you interests
<input type="checkbox" name="Computers>Computers
<br>
<input type="checkbox" name="Electronics">Electronics
<br>
<input type="checkbox" name="Sports">Sports
</form>