
-----------------------------------
krishon
Sun May 25, 2003 3:37 pm

[Tutorial] Forms
-----------------------------------
To make a fully working form, there are several things that u need to plan out.  First u can make forms that requires the user to input text into a text box.  The other form u can make is by clicking on a selection.

First of all, like all html tags, u need to start the form off with .
Inside the form tag u can put different attributes, look at the example below:





As u can see there's a method attribute.  It can be either post or get in those quotes, but post is the best for forms.  The action there is used to run cgi script that processes the information from the form and sends an email.  There are two hidden input types, with the names of recipient and redirect.  The recipient one is used to send the processed info to quotes@metallicsurge.com, while the other one makes a news page appear.

Now we get into the actual form making.  I will explain the text boxes first.


 
    Company / Organization
    

    


 
    Company / Organization
    

    


phone 

This one is about the same except that there is a maxlength attribute.  It is used to limit the number of characters in the textbox.  When you ask a user to put in a telepholne number, this works very well.



Put comments

This is used for larger inputs from the user.  In this case, it is used to get comments from the user.  This is much like the message body in this forum, where u type ur message.  The size can be changed by altering the cols and rows number.

K, the text stuff seems ez enough dusn't it? well now lets go on to a bit more difficult stuff.

The first thing is the pulldown selection.  Here's a small example:



 
    Â 
      How would you like your request responded to?
      Â 
    
        
          Telephone 
          Email 
        
      
  


As you can see u have the question, but make sure u have the form tags in there too.  Select name is just like the input name from the text area, where u name the textarea.  Now there are the option tags.  U do not need to put a close tag on them, just like a list item  in lists.  the selected attribute just makes that option the default.

Ez enough? Now for the check boxes:



   

   Checkbox 1 here

   Checkbox 2 here



   

   Checkbox 1 here

   Checkbox 2 here
