Web Design Stuff
HTML Tutorials    CSS Tutorials    Web Hosting   Resources
Create a Web Page 101
Making Web Pages Intro What is a Web Page? Why Make a Web Page? The History of HTML Learn HTML or XHTML?
Basic HTML
Basic HTML Tutorials Basic HTML Necessities How to Make a Web Page How to Edit a Web Page The Basics of HTML Tags Basic HTML Page Structure HTML Attributes
HTML Font Codes
HTML Font Codes Intro HTML Font Color Codes HTML Font Size Codes HTML Font Style Codes HTML Bold/Italic Codes Combining Font Codes
Formatting Text
Formatting Text Intro Making Paragraphs Miscellaneous Formatting Headings & Subheadings Creating Hyperlinks
Using Graphics
Using Graphics on the Web Add Graphics to Your Pages Graphics and Accessibility How to Align Graphics Page Color & Background Graphics as Hyperlinks Horizontal Rules
Creating Tables
HTML Tables Tutorials HTML Table Fundamentals Background & Border Color Table Frames & Rules Table Width and Alignment Cells 1 -Space & Alignment Cells 2 -Row Column Span Cells 3 -Width & Height
Making Lists
HTML Lists Tutorials Bulleted Lists Numbered Lists Definition Lists
HTML Frames
HTML Frames Tutorials Using Frames for Layout Advanced Frame Layouts Putting Hyperlinks in Frames Frame Border Width Color, Margin and Control Problems with Frames SmartFrames: A Solution SSI: An Alternative to Frames
Web Page Forms
Making Feedback Forms A Simple Feedback Form Installing NMS FormMail Debugging Your Setup My Web Host is Out to Lunch User Input Components Text Fields Checkboxes & Radio Buttons Dropdown Menus Push Buttons Layout and Presentation
Basic CSS
Basic CSS Tutorials What is CSS? Why You Should Use CSS How to Use CSS Inline Styles Embedded Style Sheets External Style Sheets Class Selectors ID Selectors Combining Selectors
CSS Properties
CSS Properties Intro Font Styles Width, Height & Spacing Borders Backgrounds Position Float & Alignment Hyperlinks
All About Web Hosting
Hosting Your Own Website What is a Web Host? Your Website's Home Page Building a Website Offline About Free Web Hosting Best Free Web Hosting Commercial Web Hosting How to Get a Domain Name Ecommerce Web Hosting Web Hosting Terminology
Free Web Design Tools
Best Free Website Tools Best Free Text Editors Best Free Graphics Editors Free Website Analysis Tools
Setting Up HTML Kit
HTML Kit Introduction How to install HTML Kit Screenshot Breakdown Basic Configuration Overall Appearance Shortcuts and Startup Editing Window Customizing Toolbars Using the Favorites Tab Making a New Actions Bar Odds and Ends
Free Templates
Free Website Templates Two Column Fixed Width Three Column Liquid Layout Miscellaneous Templates Dynamic Menu Effects Two Column Experimental Terms of Use About These Templates
Website Templates Help
Getting Started Template Zip File Download How to Edit Your Template What to Edit in the HTML How to Add Your Logo Making a Website
Web Design Tips
Web Design Basics Tables vs. Tableless Using Tables for Layout Example Table Layouts World's Crappiest Web Page
Twitter Backgrounds
Twitter Backgrounds Intro Cool Twitter Backgrounds Cool Twitter Backgrounds 2 Plain Twitter Backgrounds Dark Twitter Backgrounds Best Twitter Backgrounds Cute Twitter Backgrounds Music Twitter Backgrounds Music Twitter Backgrounds 2 Twitter Backgrounds 101 TERMS OF USE
All About Web Browsers
What is a Web Browser? Mozilla Firefox Internet Explorer Opera How to Set Up Firefox Top 5 Firefox Extensions
 
Contact
Post Some Feedback Send Me An Email Iron Spider Blog About Iron Spider... Site Conventions
 
 
 

 

A Simple Feedback Form

 
ON THIS PAGE
  • An Example Form
  • How This Form Works
  • The Form Element
  • Text Boxes
  • Submit Button
  • Putting It All Together
 
To compel the average web surfer —arguably one of the most demanding individuals on the face of the earth— to click on an email link, wait for their email program to open up, remember how the email program works and then send you an email is, in fact, a formidable task (Oh bother! My email program takes 7.2 seconds to load! You can't be serious!!)

Hence, as a matter of convenience (and to show everyone that you are above the cut by displaying some advanced web design skills) you might want to create a feedback form that visitors can use to send you an email directly from your contact page. The following is a crash course on how to create such a form.


An Example Form


Below is an example of a simple feedback form. The user types the appropriate information into the three text boxes and then clicks on the "Submit" button to send the data as an email to the designated recipient (you).


Your name:


Your email:


Your comments:


^ Top ^


How This Form Works


What's going on behind the scenes can be roughly divided into two parts. The first part is the HTML source code that actually renders this form in a web page. In this source code, each of the three text input boxes is identified by a unique "control name".

The second part of the form is a form mail script (kind of like a little program) that is configured and placed in a special folder in your website's root directory called cgi-bin. When the user clicks on the Submit button, the form calls the form mail script into action. The form mail script uses the text box control names to collect and organize the information entered into the form and then sends it off as an email.

Most webmasters will only concern themselves with how to render the form using HTML source code and then afterward download and install a ready-made form mail script to process it. There are many free ready-made form mail scripts to be had out there on the internet. If you're looking for a quality open-source (free) form mail script, I personally recommend NMS FormMail. For more information, please see Installing NMS FormMail.

^ Top ^


The Form Element


Okay so let's deal with the first part of our simple feedback form which is the HTML source code required to create it.

Creating forms starts with the form element which acts as a container for all the other special elements that are used to render various form components. The form element has a start tag <form> and an end tag </form> and has two important attributes, action and method, which are described below:
  • action ~ The value of the action attribute contains the URL to the script that will process the form (we'll get to that later...)
  • method ~ The value of the method attribute is either GET or POST. You will use one or the other depending on the requirements of the script processing the form. The method most commonly used is POST.
So far then, the HTML source code to our feedback form looks like this:


<form action="URL to form script" method="POST">
Other special elements go here...
</form>


To help with layout and presentation, the <form>...</form> tags may also contain most other HTML elements but, with the exception of <br> tags, we'll leave them out for now to keep this tutorial simple.

^ Top ^


Text Boxes


Now let's create the text boxes used in our simple feedback form. The two HTML elements used to create text boxes (also known as text fields) are input and textarea. These are described below:
  • input ~ The input element will create a single-line text box when the type="text" attribute value pair is used. Only the start tag <input> is used. The end tag is omitted. You will also require a name="control_name" attribute-value pair where control_name equals the control name (whatever you want) that you assign to this text box. This control name will be used by the script that processes this form to retrieve the data entered into this text box. Each input text box must have a different control name.

    So if we insert the following code inside our form element:


    Your name:<br><input type="text" name="realname"><br><br>
    Your email:<br><input type="text" name="email">




    ...it will render the following result:

    Your name:


    Your email:

  • textarea ~ The textarea element creates a multi-line text box. It requires both a start tag <textarea> and an end tag </textarea> and the rows and cols attributes are used in the start tag to define its display size. These attributes are described below:

    • rows="number_of_lines" — This attribute-value pair specifies the height according to the number of text lines you wish the textarea box to display.
    • cols="width_in_characters" — This attribute-value pair specifies the width according to the number of character widths you wish textarea box to display.

    Also, like the input text boxes, we have to include the name="control_name" attribute-value pair where control_name equals the control name (whatever you want) that you assign to this text box. Hence if we insert the following code inside our form element:


    Your comments:<br>
    <textarea name="comments" rows="15" cols="50">
    </textarea>




    ...it will render the following result:

    Your comments:

    This textarea box is 15 text lines high and 50 character widths wide.

^ Top ^


Submit Button


Now let's create a submit button that the user can click on to activate our simple feedback form after entering his or her information. Once again we'll use the input element but this time we'll insert the type="submit" attribute-value pair. To customize the text that is displayed on the submit button, you can use the value="your text" attribute-value pair where your text can be anything you want. To keep it simple (and polite) we'll just use the word "Submit". Hence if we insert the following code inside our form element :


<input type="submit" value="Submit">


...it will render the following result:


^ Top ^


Putting It All Together


Alright then, if we take all the HTML source code for our form element, text boxes and submit button and put it all together, the following is what we get:


Your name:


Your email:


Your comments:


 


So all you have to do is whip up an essential web page structure (or use a web page that you've already created) and then insert the above source code anywhere in between the <body>...</body> tags and then presto...

You got yourself a simple feedback form.

For the purposes of the next tutorial on installing NMS FormMail, let's name this feedback form page "contact.htm".


*   *   *


Next, let's deal with the second part of our feedback form which is the script that will actually process the form when a user clicks on the Submit button...





Best Free Stuff
for webmasters

Free Text Editors
Free Graphics Editors
Website Analysis Tools
Free Website Templates

See also:

Best Free Web Hosting

 

If you need a .COM web address, you can get one quick and easy at...

www.GoDaddy.com
INTRO TOP NEXT ~>
 
HTML Tutorials |  CSS Tutorials |  Web Hosting |  Domain Names |  Web Design Resources
Iron Spider © Copyright 2004-2011 Robert Darrell