Electric Type

Multimedia

About Us

News

Help

Good Forms
by Jay Greenspan 23 Jul 1999


Page 1

So you've decided it's time to interact with your users. You're tired of this one-way street — you talking, them listening. You want to actually hear what your readers have to say. In order to do this, you'll need to provide a way for people to enter information. Therefore, you're going to need an HTML form (to process this information, however, you must implement some sort of script, which Tim shows you how to do in his CGI article).

Like everything else in HTML, forms are really easy: just drop a few tags into your favorite text editor and you're good to go. Here, take a look:


<form action="nextpage.html" method="get" name="myform">

</form>

These tags are going to be the shell of every form you create. It's nothing too complicated: just opening and closing <form> tags, which house the meat of the form (which we'll get to in the following pages). Notice that there are three attributes in the opening tag: action, method, and name. I'll be talking about method a little later, but for now let's take a gander at the other two.

You're always going to want an action attribute. Why? Because you want your form to do something. The form itself just collects the information; you're going to need a program that works within the form. The action attribute will point to a script that will process the information that's been entered.

Then we come to the name attribute. This one's pretty easy. It's not really necessary, but it's best to get in the habit of naming your forms (so if you ever want to use forms with JavaScript, you'll be ready).

Now, let's move on to the method attribute and the most simple form element, the ever-popular textbox.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.