MacBoy's
Super Simple FORM TUTORIAL
for GeoCities, Part 2:
What happens to the form?


Now it's on its way...

When someone fills out your form and hits the "submit" button, the server at GeoCities looks up your MemberName (which you've put in the opening form tag) and gets the e-mail address from your Personal Profile. The server then formats the replies in the form and mails it off to you.

(Note: The form results will be e-mailed to the address in your GeoCities Profile, ususally the email at your ISP. It DOES NOT get sent to the GeoCities e-mail address (you@oocities.com) OR a specific page in your site for automatic input. To get your OWN free GeoCities Guestbook -which WILL enter the info into a special page for you - please go HERE! )

Here's a sample form result as it might appear in your mailbox (This one is from Eudora; other mail programs might look a bit different)

Date: Sat, 21 Mar 1997 04:43:38 -0800
Reply-to: wsmitherz@oocities.com (WSmithers)
From: wsmitherz@oocities.com (WSmithers)
To: macboy@bismart.com

Subject: FORM results

Sent from Mail Form posted at: http://www.oocities.org/WestHollywood/Heights/basicforms.html

(from-name) WSmithers
(from-email) wsmitherz@oocities.com
(Comments)
---------------------------------------------
Great Site! Especially liked the picture of the
dog with the ice cream!
Keep up the nice work!
---------------------------------------------


Neat Trick Number One

This is where we see one neat trick take effect.
Those of you who already know this stuff (um... why are you reading this?) may have noticed that the NAME and EMAIL tags look a little different than what most people use.

In the source code we learned on the previous page, we've written in
input name="from-name" and input name="from-email"
instead of the usual
input name="name" and input name="e-mail" for the text box subjects.

These particular subject tags will place whatever is entered into the appropriate sections right into the e-mail. Without these particular "name" definitions, the same form entries would look like this:

Date: Wed, 5 Mar 1997 09:40:47 -0800
Reply-to: macboy@bitsmart.com (Geocities WebMonitor mail)
From: macboy@bitsmart.com (Geocities WebMonitor mail)
To: macboy@bitsmart.com

Subject: FORM results

Sent from Mail Form posted at: http://www.oocities.org/WestHollywood/Heights/basicforms.html

(name) WSmithers
(email) wsmitherz@oocities.com
(Comments)
---------------------------------------------
Great Site! Especially liked the picture of the
dog with the ice cream!
Keep up the nice work!
---------------------------------------------

You'll note that the "Reply-to:", "From:" and "To:" fields are less than useful, since your e-mail's IN BOX info for this and any other form replies you've received will all say the same thing.
See? You're already WAY ahead of a lot of other people. Your IN BOX will be nice and sensible. You're practically a Form Wiz!

NOTE: This "From-" attribute ONLY works with "-Name" and "-EMail" as it puts these two in your e-mail's Header. Adding "From-" to ANY other tag (ie: "from-URL" or "from-favourite song") is of no use. It SHOULD ALSO work with "Subject" but GeoCities's script has a typo there so until they get around to repairing it, the e-mail's "Subject" headers will remain empty :-(


Let's do something about that "Subject: FORM results" line...

You can specify a Subject for the e-mail's header easily now. This would be quite usefull if you had a couple of forms for different topics on your pages.

Right below the opening form tag, put in this line, using whatever short description of the form you need, such as a form for "Song Requests":

<input TYPE=hidden NAME=subject VALUE="Song Requests">

This will cause the input from this tag to display in your form's "Subject:" header. If you DON'T specify a Subject, then the generic and rather uninformative "FORM results" line will be placed in that header.


Any other neat secrets?

Yup! Two of 'em!

Want to have the visitor fill in a particular field, but find many don't bother with some of them? You can make some or all of your fields "Required" before they can send the form on!
Let's say you really HAVE to get their favourite song. You'd normally just type in this code:

<strong>Your Favourite Song:</strong><br>
<input name="Song" TYPE=text SIZE="30"><p>

To make it a REQUIRED field, you'd type this:

<strong>Your Favourite Song:</strong> (Required)<br>
<input name="require:Song" TYPE=text SIZE="30"><p>

and get this:

Your Favourite Song: (Required)


Test this by submiting this short form without entering anything and see what resulting message they'll get if they don't type in anything.

You can "require" any TEXT field at all, just add "require:" in the name attribute such as "require:from-name" or "require:URL" or "require: Short Story" for a comment field. You should always let the readers know WHICH fields are required (and which are optional, by default) so they'll know they MUST fill in this one or that one.

What you CAN'T do is force them to enter accurate info. So even a "require: URL" tag can have "%$#%$#M*&J" entered and the script will allow it to be sent on. It will only check to see if the field is EMPTY or not.

You can't "require" buttons or lists, though :(


So... what was that other trick?

That one's in the comment box, and it helps out anyone using Netscape to view your pages: use "WRAP=PHYSICAL" in the TEXTAREA tag. The code, once again, looks like this:
<textarea name="Comments" rows="7" cols="60" wrap=physical></textarea>

For those using Netscape: Check out the difference between the two text boxes below.
For those using Explorer: Since this will look fine to you, check out this picture of what your Netscape visitors might see. Then, disregard the Browser Wars and remember to add the tag.

A typical comment box, without the wrap:

Our cool WRAPPED comment box:


What's up next?

There are more things you can add to a form, like check boxes, lists, radio buttons and so on. We'll look at those items next.


Front Page | Before we start...
PART ONE: The Basic Form | PART TWO: What Happens
PART THREE: Form Buttons | PART FOUR: Lists
Survey Form | What You've Said...
F.A.Q.: Troubleshooting

Need More Help?

If you need further help with your form, visit the Counters, Forms & Imagemaps Help Forum. Please read the posts that are already up to make sure your question has not already been asked and answered. If you don't see your question covered already, just add it in, making CERTAIN that you add the URL to the problem form, if it's in your directory.
LinkExchange
LinkExchange Member Free Home Pages at GeoCities

© 1997 MacBoy