Last on the list are the SUBMIT and RESET buttons:
<INPUT TYPE=SUBMIT>
SUBMIT sends the data.
RESET clears the form.
<INPUT TYPE=RESET>
We can easily change what the buttons say.
<INPUT TYPE=SUBMIT
VALUE="Send it away away"><BR>
<INPUT TYPE=RESET
VALUE="Clear the form"><P>
The SUBMIT button can also have a NAME. You would need this if you had more than one SUBMIT button.
Next we must tell the browser where to send the data we gather and how to send it. There are two basic things you can do:
1) You can send the data to a cgi script for processing
2) You can have the data emailed to you
As for the first, whoever wrote the script can tell you how the data should be sent.
The second, or mailto form should have the following attributes in the <FORM> tag.
Note - Microsoft's Internet Explorer 3.0 does not support mailto forms.
When you try to submit the information, the new mail message window pops up.
Explorer does however support forms sent to a CGI script.
<FORM
METHOD=POST ACTION="mailto:xxx@xxx.xxx" ENCTYPE="application/x-www-form-urlencoded">
This line is very important. The only thing you have to do is plug in your email address after mailto: The rest must be written exactly as shown. The words FORM, METHOD, POST & ACTION do not have to be capitalized but there must be a space between each attribute - between FORM & METHOD, between POST & ACTION, and between .com & ENCTYPE.
Unfortunately the data will be sent to you in this 'only useful to a computer' format:
FORMNAME=New+Entrant&NAME=R.U.+Havinfun&ADDRESS=1313+Mockingbird+Lane
&CITY=Beverly+Hills&STATE=CA
What you'll need is a program to turn it into 'useful to a human' format:
FORMNAME=New Entrant
NAME=R.U. Havinfun
ADDRESS=1313 Mockingbird Lane
CITY=Beverly Hills
STATE=CA
Mailto Formatter (1.3MB, Win 95) is an excellent utility that does this job quite nicely.
|
Some mail programs are capable of converting the data without resorting to a separate program. You may want to try this method first. Just remove the instruction ENCTYPE="application/x-www-form-urlencoded" and in its place use ENCTYPE="text/plain".
| |
When you put a mailto form on your page and someone sends you information, you'll notice that it is sent with a default Subject. If your visitor was using Netscape you'd get the default Subject "
Form posted from Mozilla". Other browsers might send "
Form Response", etc.
You can change this by editing what's in the <FORM> tag as follows:
<FORM METHOD=POST ACTION="mailto:xxx@xxx.xxx
?subject=Company feedback form" ENCTYPE="application/x-www-form-urlencoded">
Your Own HTML Page
Open the page "feedback.html" and add the following: (the red text is what to add)
<html>
<body background="bgnd.gif">
<center><h1>Feedback Form</h1></center>
<br>
<form
method=post action="mailto:YOUREMAILADDRESS?subject=Feedback" enctype="text/plain">
<b>My name is: </b><input type=text name="name">
<p>
<b>I work as a:</b><br>
.
.
</p>
<p>
<b>When it comes to web browsers:</b><br>
.
.
</p>
<b>I rate your site as:</b><br>
<select name="Rating">
<option value="Wow">Wow! How did you do it?
<option value="good">Really good
<option value="interesting">Interesting
<option value="hmmm">Hmmm - seen better
<option value="tryagain">Try again, bud!
</select>
</p>
<p>
<b>Comments:</b><br>
<textarea name="comments" rows="6" cols="50" wrap="physical">
</textarea>
</p>
<p>
<input type="submit" value="Send it!"><br>
<input type="reset" value="Clear it!">
</p>
</body>
</html>
Save the file.