Home Categories Submit Republish Tools Links Credits Contact
Popular Articles
 
     
 
 Categories
 
 
Submit your articles online!

Website Design And Programming - Introduction To Web Forms

By: Sergio Roth

Published: February 16, 2008
Link To Article Link To Article  E-mail Article E-mail Article  Republish Article Republish Article
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 langauge 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.



Visitor Comments

Post Comment Post A Comment
What do you think about this article? Do you agree or disagree with it? Be the first to comment on this article, and share your thoughts with the world. No registration is required to post comments.

Article Icon Computer Programming - A Brief History
If a definition of a computer is that it is a piece of equipment that needs to follow various directions in order to carry out the tasks required of it, then the history of computers can be traced back to...
Article Icon Top 10 Elements Of Open Source Development
Open source development has undergone lot of changes to emerge as powerful in recent times. Today when software's are getting expensive consistently, open source techniques can eloquently help in making...
Article Icon The Usefulness Of Each IPhone Entertainment App
Apps with break through features like Audio/video playes, music players, and social media apps.
Article Icon Form Vs. Function? Which Is More Important In GUI Development?
During GUI training, students learn about graphical user interfaces. These are interfaces that allow users to interact with a computer in ways other than only typing and text.
Article Icon The Development Of IPhone Enterprise Apps
The Enterprise apps interact with the home server to get sensitive data of your customers.
Article Icon Alarm Clocks And Online Collaboration
Have you ever bought a piece of equipment that you thought would come in very handy only to leave it lying around for months because you could not figure out how to set it up? Or not set all the functions...
Article Icon IPhone Web Application Development
Since the creation of personal computers and the World Wide Web, technology has moved on to the creation of various computer and web applications that users can enjoy while using their personal computers or...
Article Icon Hire Android Developers
Google Android is a platform for professionals, offering a wide range of options and many opportunities for development of high quality Android applications. For the highly advanced and smart choices, the...
Article Icon Who Becomes An IPhone App Developer?
It's not a classic job title like fireman, president or teacher. Exactly who becomes an iPhone app developer, and what makes the job attractive to them? Read below to learn about the personality traits...
Article Icon Characteristics Of IPhone Application Developers
iPhone application developers share a common list of traits that serve them well in their chosen profession. Read below as you learn what makes these 'techies' so good at what they do, and then commission one


Print This Article Print This Article
Add To Favorites Add To Favorites
Cite This Article Cite This Article
 
 
Home | Categories | Submit | Republish | Tools | Links | Credits | Contact | Privacy Statement | Terms Of Use
Copyright © 2012 InfoServe Media, LLC (DBA PopularArticles.com). All rights reserved.