Search
Recommended Sites
Related Links






   

Informative Articles

Basic E-Commerce Web Site Design
Nowadays, with the all-pervasive power of the internet, no one in business can afford to be ignorant about basic e-commerce web site design. After all, most brick-and-mortar retailers and wholesalers have some sort of internet presence–even...

FLASHY WEB SITE DESIGNS ARE BAD FOR BUSINESS
Have you heard yourself saying, "I don't understand? I have a gorgeous site, a really cutting-edge splash page with a flash introduction, up-to-date technology, I paid a small fortune for this site, and I'm getting plenty of hits but no one is...

Low Cost Web Design In Birmingham
There are many companies who build websites, all of which who want your business. This puts you in a very strong position when trying to obtain a good deal, a professional looking website at a low affordable price. The world wide web is an...

Never Redesign Your Web Site
Never Redesign Your Web Site By Chris Kalaboukis, CEO, SwapSmarts.com llc "We want to completely redesign our web site". If I had a penny for every time I heard that, well you know the rest. In the web design business, that's all I ever...

Website Design Tips by San Diego Internet Marketing Professionals
Approaching the year 2006, many San Diego Business's have recognized the importance of bringing there business to the millions of people that utilize the Internet on the daily basis. If you are one of those businesses in this decision...

 
Website Design and Programming - Introduction to Web Forms

There is practically no website without at least a form in one of its pages. Forms are useful to collect data from the website visitors and users. Once the user submits the form to the server, a form processing script must get the form data, validate that the user input matches the expected format for each field (e.g: email address field must be a string of text with the format of a valid email address) and process this information as desired. The script may save it into a database, send it by email or just do some processing with it and display the result. Validating the user input is essential to prevent malicious users from damaging your site.

A form definition in html starts with the form tag and ends with the /form tag. This tag can have several attributes like method (GET or POST), and action (the url of the form processing script). If use the GET method, the form data is encoded in the action URL. This method is recommended when the form is a query form. With the POST method, the form data is to appear within a message body. This is the recommended method when the form will be used to update a database, or send email, or make any action other than just retrieve data.

The form fields are used to collect the data. Generally a label is placed by each field, so the user knows what data to input. There are different kind of fields, among them:

• Textboxes

• Textareas

• Drop-downs

• Multi select

• File

• Radio buttons

• Checkboxes

• Buttons

• Hidden

The hidden fields are used to send some data that the user does not need to see, along with the form. An example of this could be a form number, so the form processing script identifies which form has been submitted.

The File field allows users to upload a file. The form processing script will get the file together with the rest of the form data. For this field to work properly, you need to include this attribute in the tag: enctype="multipart/form-data".

Buttons are used to submit or reset the form.

Refer to an HTML guide for full description on the attributes and syntax of each tag. You may find a guide at http://www.w3schools.com/tags/default.asp or at http://www.w3.org/MarkUp/ among many other sites.

When the form is complex, it is useful to group fields in areas using the fieldset tag. Just place the fieldset tag, then optionally a legend Section Name /legend tag, then all the pertinent form fields, and the /fieldset tag after them.

It is possible to use CSS (Cascading Style Sheets) or inline styles to change the look of the form controls.

You can bring your forms to a different level by combining them with the usage of scripting language like JavaScript. You can make the form react immediately to certain events, like the user clicking on a control, or a field changing its value. You can highlight the field that has the focus, for example. Or count how many characters have been entered in a text box or a textarea. You can make calculations and display the results automatically. The possibilities are endless.



About the author:

Sergio Roth is an experienced freelance web programmer. You can contact him for hosting and website development services at http://www.ayreshost.com.

Sign up for PayPal and start accepting credit card payments instantly.