magazine resources subscribe about advertising

New Architect Daily
Commentary and updates on current events and technologies

CMP Media E-Book

Download your copy today.

Research
Search for reports and white papers from industry vendors and analysts.

This Week at NewArchitect.com Subscribe now to our free email newsletter and get notified when the site is updated with new articles







Day of Defeat Online Gaming

 New Architect > Archives > 1997 > 05 > Script Junkie  

By Reaz Hoque

An Online Order Form in JavaScript

Many Web designers realize that form-based Web pages give them too much to worry about. Forms can be used for purposes as simple as submitting visitor feedback or displaying a catalog or product directory. But no matter how simple or difficult the form is, the developer must still learn CGI, have access to a CGI-bin directory, ensure that the CGI script runs fast, and so on. Enter JavaScript, the client-side scripting language that provides a viable alternative for handling HTML forms.

JavaScript lets you submit forms faster than CGI, and can also save a lot of programming time and money. This article presents a script that selects computer parts from a list and calculates their prices. You can then fill in the necessary shipping information to order the selected computer components. Once sent, the order information will be received by a configurable email account from which the order can be processed.

Start with HTML

First, you'll need to create the HTML page that will interact with JavaScript. The entire page is basically a form defined using the HTML code in Figure 1(a). Use the POST method for the form, and, because the information will be sent via email, set the form action to the email address of the person who will be processing the order. Be sure to set the encryption type to "text/plain" (ENCTYPE="text/plain"), or your email data will be encrypted, which will make it exceedingly difficult to understand.




  Day of Defeat Online Gaming

home | daily | current issue | archives | features | critical decisions | case studies | expert opinion | reviews | access | industry events | newsletter | research | careers | info centers | advertising | subscribe | subscriber service | editorial calendar | press | contacts


Copyright © 2006 CMP Media, LLC Read our privacy policy, your California privacy rights, terms of service.
SDMG Web sites: BYTE.com, C/C++ Users Journal, Developer Pipeline, Dr. Dobb's Journal, DotNetJunkies, MSDN Magazine, Sys Admin,
SD Expo, SD Magazine, SqlJunkies, The Perl Journal, Unixreview, Windows Developer Network, New Architect

web2