Tactical Panda Forms Pages
 
  Home Page •  About Us •  Search •  Contact Us •  Bookmark  
"Helping you to help yourself to the internet!"  
 
Contents
Colour
Forms
Free Stuff
Graphics
HTML
Javascripts
Cascading Style Sheets
Tables
Website Templates
 
In Brief...
 
Forms (2)

Using Forms

Welcome to the second Forms Page! As promised here is the example, followed by the coding so far enclosed in the table we designed:

Your Name:
Your e.Mail address:
I live in:
Telephone:

Question One
Question Two
Question Three

Question Four
Question Five
Question Six

The code is:

<center><table border="1" cellpadding="2" cellspacing="2" width="90%">
<tr><td valign="top"><font size="3" color="#FF0000"><b>Your Name:</b></font>
<BR><input type="text" name="Name" value="" size="20">
</td><td valign="top"><font size="3" color="#FF0000"><b>Your e.Mail address:</b></font>
<BR><input type="text" name="Name" value="" size="30"></td>
</tr><tr>
<td><font size="3" color="#FF0000"><b>I live in:</b></font>
<BR><select name="country">
<option>Please select:
<option>United Kingdom
<BR><option>United States
<BR><option>France
<BR><option>Germany
<BR><option>Belgium
<BR><option>Italy
<BR><option>Other country
<BR></option></select></td>
<td><font size="3" color="#FF0000"><b>Telephone:</b></font>
<BR><input type="text" name="telephone" value="" size="25"></td>
</tr><tr>
<td><input type="checkbox" name="One" value="" onfocus="this.blur()"> Question One
<BR><input type="checkbox" name="Two" value="" onfocus="this.blur()"> Question Two
<BR><input type="checkbox" name="Three" value="" onfocus="this.blur()"> Question Three</td>
<td><input type="radio" name="Four" value="" onfocus="this.blur()"> Question Four
<BR><input type="radio" name="Five" value="" onfocus="this.blur()"> Question Five
<BR><input type="radio" name="Six" value="" onfocus="this.blur()"> Question Six</td>
</tr></table></center>

So far so good? It looks really complicated, but really it's not! Most of the coding above is for the table, take that away and it gets real easy.

Okay, let's give the visitor something to say rather than just answer questions. To do this we will need a 'Text Area' box. This can be virtually any size you want, for example:

This one is 5 rows high and 30 columns wide, but you can tailor it to the size of your form and web page. The visitor writes text in the box and it will be received exactly how they typed it! Be careful!

The coding for a <textarea> as it's called looks like this:

<textarea name="comments" rows="5" cols="30"></textarea>

The things to remember with a <textarea> is that (a) you can make it any size you want, but too big is very off-putting for the visit, they think they have to re-write 'Gone With The Wind' if it's too big! Secondly, you will notice from the coding that you must close the <textarea> immediately with </textarea>, and nothing between. You should give it a name as usual, in this case 'comments' will suffice, it helps you identify it later when the e.mail arrives, and helps the CGI host identify what it is.

Now add the comments box to the forms and it's beginning to take shape, and looks like this:

Your Name:
Your e.Mail address:
I live in:
Telephone:
Question One
Question Two
Question Three
Question Four
Question Five
Question Six

The final addition to the form (at last!) is a method to send it, and a way to clear the entries in the event of a typo (typing error). You will need a 'submit button' and a 'reset button' to accomplish this. The standard format makes them look like this:

 

Ugly aren't they? They can be altered in various ways to match the look and feel of your site, and I have covered that on a Javascript page. Anyway, let's get back to the buttons.

The coding for these two looks like this:

<input type="submit">&nbsp;<input type="reset">

The space between the button is provided by the &amp; or (space) command, it's not totally necessary, but if you don't use it the buttons are butted up against each other like this:

You can add the 'on focus' bit if you want, plus change the wording to be more user friendly by altering the 'value', like this:

 

<input type="submit" value="Click here to send!">&nbsp;<input type="reset" value="Click here to reset">

Then, you can change the background and font colour by introducing a piece of CSS in the <HEAD> section of your page, so it looks like this:

 

To do that, simply copy and paste the following into the <HEAD> of your page then alter the colours to whatever you like to match your website layout. In addition you must also add a bit of text to the button command itself that makes it read the CSS 'class' bit.

<style>.forms {background:"#BB0000"; color:"#ffffff";}</style>

So now the code for the submit button looks like this:

<input type="submit" value="Click here to send!" class="forms" onfocus="this.blur()">

...and the code for the reset button looks like this:
<input type="reset" value="Click here to reset" class="forms" onfocus="this.blur()">

Or you can leave it exactly as it was! Anyway, let's put it all together and see what we get on the next page...

[1] [2] [3] [4] [5]

Top

<<< Previous page
 
Home Page •  About Us •  Search •  Contact Us •  Bookmark
© Copyright 2004 Tactical Panda