the latest
October 20, 2008 New Backup Script has been launched. Some house keeping has been done around the site and we have a few new items to be added soon.

the greatest

» Backup Script
» Contact Script
» PHP Includes
» Image Gallery

Forms

Description

Some simple form instructions

Tutorial

Starting the form

<form method="post" action="thankyou.php">

This sends the data in the form to your thankyou.php page.

Text Box

Email:

The code for this text box is <input type="text" name="email">


If you wanted to create a box for a phone number you could do it like so - <input type="text" name="phone">

Text Area

Message:


The code for this text box is <textarea name="Message" rows=10 cols=30></textarea>

If you wanted to create a textarea for a description you could do it like so - <textarea name="description" rows=10 cols=30></textarea>

Radio Buttons

Join our mailing list?: Yes  No

The code for these radio buttons:
<input type="radio" name="Mailing_List" value="Yes">Yes
<input type="radio" name="Mailing_List" value="No" checked>No


As you can see you use the same name for the radio buttons but change the values to know what your user selected. Also, notice the command "checked" in the "no" button, this makes the "no" the default selection.

Checkboxes

Interests:
Sports
Electronics

The code for these checkboxes:
<input type="checkbox" name="Sports" value="Yes">Sports
<input type="checkbox" name="Electronics" value="Yes">Electronics

Unlike a radio button, a set checkboxes can have multiple selections, you should specify a seperate name and value for each checkbox.

Drop down box

How did you hear about us?:


The code for these checkboxes is:
<select name="hearaboutus">
<option selected>search engine
<option>friend
<option>yellow pages
<option>email
</select>

Notice the command "selected" this has the same function as "checked" in the radio button example.


Sending the form

Example:

The code for this button is <input type="submit" value="Send Message">

This submits the form.

Final Notes


  1. Don't forget to close your form - </form>
  2. It is helpful to name your form fields in a simple manner, this makes the information sent much easier to read.
  3. When experimenting with your form keep a back up of the original just in case.
  4. Should you require further help please contact us - http://www.rampantstudios.com/contact.php


Home : Services : Scripts : Tutorials : Hosting : Contact