How to Create a Form in HTML

By eHow Internet Editor

Rate: (0 Ratings)

Forms in HTML are used to capture data from the user via text boxes and buttons. This information can then be sent to the server for later review or processing.

Instructions

Difficulty: Moderately Easy

Things You’ll Need:

  • HTML or text file editor

Create a Form

Step1
Open the program you're using to edit your web page, open the page itself, and position the cursor wherever you want the form to display.
Step2
Type the following:
Step3
Replace "input" with an alphanumeric name that you'll use to refer to the form later.
Step4
Replace "myform.asp" with the name of a web file that you want to receive the results of this form.
Step5
Fill the form with explanatory text and any number of controls like text boxes and radio buttons to receive user input. A typical text box is created with code like this----where the "type" attribute determines that the control is a text box, and the "name" attribute is used later to refer to the control in code.
Step6
Create a "Submit" button that the user can use to send the form data to the web file specified above. This is done by typing the following on its own line:
Step7
Close the form definition by typing the following on its own line:

Tips & Warnings

  • Once you create your form, you'll still need to populate it with buttons and text boxes.
  • Input from users is always unpredictable, and you can't do much to control it using HTML alone. Ultimately, you'll benefit from learning to write code, in Javascript for example, which can error-check user input before submitting it.

Post a Comment

POST A COMMENT

Request a New How-To Article

Looking for more How To information? Chances are there’s an eHow member who knows how to do what you’re looking to do. Submit an article request now!

eHow Article: How to Create a Form in HTML

eHow Internet Editor

eHow Internet Editor

Category: Internet

Articles: See my other articles

Related Ads

Internet

Veesites
Meet Virginia DeBolt eHow’s Internet Expert.