On BNET: 3 worst things about the iPhone 3G S

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

Tags: Channel management, Scripting languages, Jason Hiner MCSE, CCNA, e-mail, Web Form, id, Web, e-mail address, HTML

  • Save
  • Print
  • Recommend
  • 25

Takeaway: 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.

  • Save
  • Print
  • Recommend
  • 25

Print/View all Posts Comments on this article

Question Fkewl | 07/02/04
Changing subject gshollingsworth | 07/06/04
Yes, this works quite well Jason HinerTechrepublic Moderator | 07/07/04
How to set priority arohilocham@... | 09/01/08
one constraint on using the mailto: kdak | 07/06/04
A second constraint... CETroutman | 07/07/04
Very true gshollingsworth | 07/09/04
encrypting the email address helps. seadrake | 07/09/04
You can set the maill application ... Jason HinerTechrepublic Moderator | 07/07/04
If you use a backend script, what script do you use? Jason HinerTechrepublic Moderator | 07/07/04
No more backend scripts for me Adamus | 07/20/04
JavaScript code example please.. webmark | 02/08/05
javascript example bschaettle@... | 04/19/05
Example BlueCollarGeek | 04/19/05
doesn't work so well on Macs padme@... | 04/19/05
RE: Set up an HTML mailto form without a back-end script sherdel_n@... | 04/06/08
sherdel sherdel_n@... | 04/06/08
RE: Set up an HTML mailto form without a back-end script raynardwe@... | 04/24/08
RE: Set up an HTML mailto form without a back-end script danny.asberry@... | 04/25/08
multiple email addresses dprows@... | 12/08/08
It's not working with Vista? mkabeer@... | 05/05/09

What do you think?

White Papers, Webcasts, and Downloads

Article Categories

Security
Security Solutions, IT Locksmith
Networking and Communications
E-mail Administration NetNote, Cisco Routers and Switches
CIO and IT Management
Project Management, CIO Issues, Strategies that Scale
Desktops, Laptops & OS
Windows 2000 Professional, Microsoft Word, Microsoft Excel, Microsoft Access, Windows XP,
Data Management
Oracle, SQL Server
Servers
Windows NT, Linux NetNote, Windows Server 2003
Career Development
Geek Trivia
Software/Web Development
Web Development Zone, Visual Basic, .NET

Meet Doc

  • Here to help you with your Document Management Needs
  • Doc is an enigma. Born to a Russian ballerina and a German electrical engineer, he grew up in various locations in the United States. He’s seen the insides of more brands, versions, and generations of printer and printer-related hardware than almost anyone.
  • To learn more about this mysterious figure check out his blog on ZDNet and his Workspace on TechRepublic. You’ll be glad you did.
  • Produced by
    ZDNet and
advertisement
Click Here