iTechtalk


If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.



Reply
Old 11-20-2008, 11:00 AM   #1 (permalink)
Member
 
Join Date: Nov 2008
Posts: 38
Lightbulb Understanding Form Processing for HTML Document

Before you start designing your form, consider what you want to do with the data you will be collecting. What can you do with the data you collect from a form? All options fall into one of three categories:

1. Saving the data for further processing
2. Returning information to the visitor
3. Taking other action (such as financial transactions)

Saving the data for further processing
You might want to do this if you require people to register for your site or if you want to collect names for a mailing list. You could store the data in a database to verify the visitor is registered before giving access on subsequent visits. You might run a raffle on your page with a prize randomly awarded to people who sign in to your site. You might require people to sign in before they download your free software or newsletter. In any case, you need to collect certain data and store it on your server—either in a database or in an ASCII file.

Returning information to the visitor
You could perform processing based on the data. For example, you might search through a book list to find books that match the visitor’s list of favorite types of literature. If the processing doesn’t require any input from the server, then this processing is better performed using client-side processing. If, however, your processing requires access to data that resides on the server, such as a card catalog, a site index, or an inventory database, then you can use the data provided by the visitor to perform server-side processing against existing data.

This is probably the most common and acceptable use of forms on the Web. People aren’t as likely to question or refuse providing information when they can get something in return, such as information they are seeking. You need to be reason able with what kind of information you require your visitors to enter. Most people will not give you a social security number or credit card information unless they are purchasing something.

Taking other action
If someone comes to your site to purchase something, that visitor expects to provide certain types of information, including personal information, payment information, and shipping information. One of the processing decisions you must make is whether you will collect and retain the payment information on the server or whether you will send the information offline to a place where it is less vulnerable to hackers. In either case, you’ll collect information using a form or a series of forms and all your site visitor normally receives back is confirmation the purchase was completed.

Inserting the FORM
There are two parts to the form: The first is the FORM element and the second is the fields or controls that accept data. Without a FORM element, your form may appear to look fine when you test it, but it will never work.

Form <FORM>
Start Tag: Required
Content: Inline elements
Form field elements
End Tag: Required

Attributes: id, class, lang, title, style: previously defined

action: the URL of the script for processing the data or a mailto address if the action is just to mail the data

accept_charsets: list of supported character sets

dir: direction of text
name: name of form for scripting

Attributes:

accept: list of MIME types for file upload
isindex: single-line text input control
method: how the data is to be sent to the script
enctype: what types of files will be accepted if one or more of form fields accept file uploads
target: the target name of the frame within the frameset, if your script is a frameset
events:

The two attributes you see used most frequently are action and method.

<FORM method=”dosomething.cfm” action=”post”>
... form fields here ...
</FORM>
moderntech is offline   Reply With Quote
Reply

Bookmarks

Tags
form, html document, processing

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:15 AM. itechtalk