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)
Subject: FORM results
Sent from Mail Form posted at: http://www.oocities.org/WestHollywood/Heights/basicforms.html
(from-name) WSmithersDate: Sat, 21 Mar 1997 04:43:38 -0800
Reply-to: wsmitherz@oocities.com (WSmithers)
From: wsmitherz@oocities.com (WSmithers)
To: macboy@bismart.com
(from-email) wsmitherz@oocities.com
(Comments)
---------------------------------------------
Great Site! Especially liked the picture of the
dog with the ice cream!
Keep up the nice work!
---------------------------------------------
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:
Subject: FORM results
Sent from Mail Form posted at: http://www.oocities.org/WestHollywood/Heights/basicforms.html
(name) WSmithersDate: 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
(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 :-(
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.
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>
To make it a REQUIRED field, you'd type this:
<input name="Song" TYPE=text SIZE="30"><p>
<strong>Your Favourite Song:</strong> (Required)<br>
and get this:
<input name="require:Song" TYPE=text SIZE="30"><p>
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 :(
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.
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.
LinkExchange Member | Free Home Pages at GeoCities |