html-form
html-form
- a printed or typed document with blank spaces for insertion of required or requested information
(merriam webster)
- An HTML form is used to collect user input. The user input is most often sent to a server for
processing.
- An HTML form is a section of a document containing normal content, markup, special elements
called controls (checkboxes, radio buttons, menus, etc.), and labels on those controls.
- A webform, web form or HTML form on a web page allows a user to enter data that is sent to
a server for processing. Forms can resemble paper or database forms because web users fill out the
forms using checkboxes, radio buttons, or text fields. For example, forms can be used to
enter shipping or credit card data to order a product, or can be used to retrieve search results from
a search engine.(Wikipedia)
1. Text Attribute
- Text is the default, with size used to specify the default size of the box that is created or how many
characters wide the text area will be. The default size is 20 characters.
Syntax:
<input text name=”label” size=”value of the size of the box”>
Sample:
<Body>
<Form>
Name: <Input type=”text” Text Name: “full name” size=”30”>
Age: <Input type=”number” Text Name: “age” size=”2” maxlength=”2”>
OUTPUT: in the text box name you can type up to 30 characters, in the textbox of age you can only type 2
number.
OUTPUT : this is a sample output of select tag and option tag. Select tag is used to select the
default option that will appear in the drop-down menu. Option tag is used to put words that will
serve as options in the drop-down list.
5. Password Tag
- This tag requires the user to enter password
- Maxlength attribute specifies the maximum number of characters a user may enter into the field.
Syntax:
<input type= “password” name=”password” size=”10” maxlength=”10”>
Sample:
<html>
<label for="pwd">Password:</label>
<input type="password" id="pwd" name="pwd">
</html>
6. Creating check boxes
- Check boxes allow users to make multiple selections from a list.
- It displays an array of choices that are visible at one, and from which users may select any, all or none.
Option Function
Name Indicates the name that will be delivered to the web server.
Value You can use one check box with the same name, but with different values
Checked Turns on the item and automatically includes it in the list and displays a check mark by
default
Syntax:
<input type=”checkbox” name=”name” value=”value>
Sample:
<html>
<p>What is your Favorite food?
<br>
<input type="checkbox" name="food" value="salad"> salad
<br>
<input type="checkbox" name="food" value="meat"> sinigang
<br>
<input type="checkbox" name="food" value="fish"> anything but fish
</html>
OUTPUT:
8. Inserting an image
- Instead of just merely using the text submit as your button you can be more creative by using
an image.
Syntax: <Input type=”image” src=”filename”>