internet.com

Go to WebDeveloper Home


hm-v6-139x61.gif

Database Journal: The Knowledge Center for Database Professionals

find a web host with:
CGI Access
DB Support
NT Servers
UNIX Servers
Telnet Access

advanced search
jobs

Get FREE Development Info via your Email!

The Webdeveloper channel
FlashKit
GIF.com
HiermenusCentral
webdeveloper Jobs
Java Boutique
JavaScript.com
JavaScript Source
ScriptSearch
StreamingMedia World
WDJ
WDVL
WebDeveloper.com
WebReference.com
XMLFiles.com

internet.com
Internet News
Internet Investing
Internet Technology
Windows Internet Tech.
Linux/Open Source
Web Developer
ECommerce/Marketing
ISP Resources
ASP Resources
Wireless Internet
Downloads
Internet Resources
Internet Lists
International
EarthWeb
Career Resources

Search internet.com
Advertise
Corporate Info
Newsletters
E-mail Offers

internet.commerce
Be a Commerce Partner










D R .   W E B S I T E®
WebDeveloper.com

February 1, 1999

Mailto Revisited / Making Web Forms Work More Effectively

By David Fiedler and Scott Clark
Dear Dr. Website®: I have used mailto: action to send an order form to our e-mail. It worked when I tested it with IE 4.0 and Netscape Communicator on my computer. But when I tried the Netscape 4 Standalone version on another computer to test-submit an order from the Web page, we did not receive the form in our e-mail account, despite the fact Netscape did not tell me if it sent the form. Is it because the Standalone version doesn't have an e-mail function? If so, does this [no form is sent] happen to other browsers that are not configured to send e-mail?

The mailto: protocol is used to launch and set up an e-mail application, similar to the way the http: protocol is used to launch and set up a browser application. When the mailto: protocol was first initiated, all kinds of tricks were used to wrest control away from the browser for these links, so that people could use their favorite e-mail programs rather than the browser's internal e-mail (if any).

Now things are more civilized. MAPI (Mail Application Program Interface) lets your preferred e-mail application intercept mailto: URLs. Also, browsers tend to ask users what their preferred e-mail application is (in Microsoft Internet Explorer, see Tools/Internet Options/Programs; on Netscape, see Edit/Preferences/Mail & Newsgroups. You can check Netscape Messenger, or not).

This means that if someone is using a browser (such as Netscape Navigator Standalone) and doesn't have Netscape Messenger or any other MAPI-aware e-mail application configured, they won't be able to automatically launch their e-mail program when they click on your mailto:. That's why the only sure way to take orders via the Web is with a CGI program that mails the output of a form directly to you. There are dozens of Perl scripts that do this; several are available at ScriptSearch.

This can be seen with other protocols as well. For instance, the CuteFTP program can be minimized to the system tray and set up to intercept ftp: URLs pasted to the clipboard, so that you can download files using it rather than your browser.

Dear Dr. Website®: I have a group of forms with a submit button. When the user hits the submit button, I'd like three things to happen:

  • Run the Perl script for the form data
  • Use JavaScript to send an alert message
  • Use JavaScript to close the window that contains the forms.

My guess as to how to do this is to put the usual ACTION attribute in the FORM tag and also include an ONSUBMIT to handle the alert and window closing. Correct?

You're correct, you can use more than one function when you submit the form:


<SCRIPT LANGUAGE="JavaScript">
function doit(){
alert('Welcome to our home page.');
document.myform.submit();
this.close()
}
</SCRIPT>
and in the form, instead of a standard submit button, you'd use:

<INPUT TYPE=BUTTON VALUE="Go" onClick=doit()>

Visit The Dr. Website® Archives.
Click here for a list of Dr. Website's most frequently asked questions (and answers!).
Send your own question to Dr. Website®.

Fast Jump to Anywhere on WebDeveloper.com®:


Contact the WebDeveloper.com® staff

Last modified: 20

 

Refresh Daily
Join Editor-in-Chief David Fiedler The Editor With No Time and find truth, justice, and a clue or two.


Browse by Category
[ Site Map ]

ActiveX / VBscript
Animated GIF Archive
Browsers
CGI / Perl
Database Connectivity
E-Commerce
HTML-Advanced: DHTML, CSS
HTML / Site Authoring Tools
Intranet/Groupware
Java
JavaScript
Multimedia: Audio / Video / Streaming Technologies
Opinions
Refresh Daily: Editorial Column
Security
Servers & Server Tools
Site Design / Graphics
Site Management / Marketing / Log File Analysis
VRML / 3D
XML


internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs