Paul McFedries' Web Home


The cover of The Complete Idiot's Guide to Create a Web Page The CIGHTML Mailing List
Frequently Asked Questions - Forms

Main FAQ page

How can I make it mandatory for a user to fill in a particular form field?

You can do this with JavaScript. I have a script on my site that shows you how it's done..

Is it possible to use JavaScript to take form data and record it on another page?

No, JavaScript can't create a page or add text to an existing page. This can only be done using CGI.

How can I make a drop-down list of links?

You can do this with JavaScript. I have a script that shows you how to set it up.

How can I use an image instead of the usual SUBMIT button?

Use the <INPUT TYPE=IMAGE> control:

<INPUT TYPE=IMAGE SRC="someimage.gif">

Replace someimage.gif with the name of the image file that you want to use. Two things to note:

  • This type of button acts just like a SUBMIT button. That is, when the user clicks the image, the form is submitted to the server.
  • When the user clicks the image, the browser sends not only the form data, but also the coordinates, in pixels, of the spot on the image where the user clicked. These are sent as "x" (the horizontal coordinate) and "y" (the vertical coordinate).

How do I use a form's Submit button to create a link to another page?

You could set up cute little mini-forms that consist of just a single BUTTON control. You add the JavaScript onClick attribute and use it to set the location property to the address of the Web page you want to load:

<FORM>
<INPUT 
   TYPE=BUTTON 
   VALUE="Paul's Place" 
   onClick="location='http://www.mcfedries.com'">
</FORM>
Create a separate mini-form for each link. Note, too, that you'll need to use a table if you want to line up the buttons side-by-each.

What is this "cgi-bin" thing that I see all over the Web?

"cgi-bin" is the name of a directory where CGI scripts and programs are stored.

How do I get the email address of a person who fills in my form?

Include a field in the form and ask the user to enter their email address in that field. Note that although there are ways to grab a person's email address automatically, this is considered to be unethical. I think of it as equivalent to rifling through someone's purse or wallet to get their home address.

I'm using your MailForm service, but it doesn't seem to work. Is it still available?

Yes, MailForm is still available. If you're not getting messages, check the following:

  • The most common MailForm mistake is to misspell one of the hidden field names. For example, lots of people accidentally spell the "MFAddress" field as "MFAdress".
  • Double-check that your e-mail address is correct in the MFAddress field.
  • Make sure the address you use in the MFAddress field is the same address that you specified when you registered.
  • Make sure you have all your quotation marks in place.
  • Check out the MailForm instructions page for the latest updates and improvements.

Main FAQ page


Copyright © 1995-2008 Paul McFedries and Logophilia Limited