Software optimize

Set up an HTML mailto form without a back-end script

You don't have to use a back-end script to set up an HTML form. See how you can use a simple bit of HTML to accomplish the task.
<IMG SRC="http://techrepublic

Problem

IT professionals are often in charge of managing content on company Web sites and/or intranet sites. One of the most common interactive features used on these sites is the standard Web form, which allows customers and/or employees to submit information. However, setting up these Web forms typically requires a back-end script written in Perl, ASP, PHP, etc., and special server access for the script. That can make it difficult to quickly deploy a new Web form.

Solution

There's a way to set up a Web form so that it doesn't require a back-end script. By using some simple HTML "mailto" code, you can set up the form so that the results are automatically e-mailed to an address you specify.

The code looks like this:

<form action="mailto:admin@example.com" enctype="text/plain" method="post">
<p>Name: <input name="Name" type="text" id="Name" size="40"></p>
<p>E-mail address: <input name="E-mail" type="text" id="E-mail" size="40"></p>
<p>Comment:</p>
<p><textarea name="Comment" cols="55" rows="5"
id="Comment"></textarea></p>

<p><input type="submit" name="Submit" value="Submit"></p>
</form>

The form will look like this:

Name:

E-mail address:

Comment:

You can copy and paste the HTML code from above into a standard HTML page. To get this form working right away, just change the e-mail address in "mailto:admin@example.com" to the appropriate address for your organization. You can also tweak other settings such as the size of the fields.

One drawback to using this method is that when users hit the Submit button, they will receive from their Web browser a message that requires approval for the e-mail being sent. Some users may get confused or intimidated by that, so you may want to put a short blurb on the Web page that tells users to expect the message from the browser and to approve it when it pops up.

0 comments