HTML Tutorial - HTML Forms
The <form> tag or form element is used to create forms which let the user enter text or information into a text area or form field (e.g. email form). The form element can also be used to create check boxes or so called radio buttons in order to let the user select from a number of choices.How To Create A Form
Here is the basic HTML syntax for a form with two input fields <input>:<form> <input> <input> </form>
Here is what this basic HTML form example looks like in a browser window:
Click into the form fields and you will be able to enter information and text.Text Fields And Password Fields In A Form
A text field lets the user insert text into a form field. A password field lets the user enter text into a form field as well, but instead of the text being displayed as in a text field, the text is substituted with bullets or asterisks. Here is an example of a username and password form:<form action="demofile.cgi"> Username: <input type="text" name="user" /><br /> Password: <input type="password" name="password" /> <input type="submit" value="submit" /> </form>
Here is what this basic HTML form example looks like in a browser window. Notice the password field displays bullets or asterisks instead of text:
When the user clicks on the submit button, the attribute action in the form tag is used to send the information to the file specified in the action attribute (demofile.cgi). This file then processes the information further.HTML Forms - Radio Buttons
Radio buttons are used to provide the user with a limited number of choices of which only one option can be selected. Here is an example of a radio button form:<form action=""> <input type="radio" name="colors" value="red" /> Red <br /> <input type="radio" name="colors" value="green" /> Green <br /> <input type="radio" name="colors" value="blue" /> Blue </form>
Here is what this basic HTML radio button form example looks like in a browser window:
Click on any of the radio buttons and you will notice that only one selection is permitted.HTML Forms - Check Boxes
Other than radio buttons, check boxes are used to provide the user with a limited number of choices of which multiple options may be selected. Here is an example of a check boxes form:<form action=""> <input type="checkbox" name="colors" value="red" /> Red <br /> <input type="checkbox" name="colors" value="green" /> Green <br /> <input type="checkbox" name="colors" value="blue" /> Blue </form>
Here is what this basic HTML check boxes form example looks like in a browser window:
Click on any of the check boxes and you will notice that multiple selections are permitted.
HTML Related Links
- How to Get a Web Site or Online Business Started
- CMS - Content Management System
- How to Choose and Register the Right Domain Name
- Making Revenue - How to Make Money With a Website
- Server and Hosting
© This Article is Copyrighted by WebmasterSeminar.com
Please do not copy or reproduce this article in whole or part, in any form, without mentioning the source and including a live link back to WebmasterSeminar.com - Thank You!LINK TO THIS TUTORIAL:
Copy the code below and paste into your web page
<a href="http://www.webmasterseminar.com/htmlforms.php"> Webmaster Seminar</a><br /> HTML Forms - Free Information, Tutorials and HTML Resources