
					FORMS



Forms are probably just what you think they are. Have you ever had to fill out
a job application, or questionnaire online? You need a spot to enter your name,
etc. I will show you how to do this.

First, define the form tag:


<html>
<body  bgcolor=lightsteelblue  text=black>


<form name="myForm">



</form>



</body>
</html>


There are many different types of form elements. We will discuss 3 main types.

1  INPUT tags

 

<form name="myForm">

<input type="text" name="firstName">

<br><br>

<input type="text" name="address">

</form>

View the page.     But which field is which?     Label them.


<form name="myForm">

Name:  &nbsp; <input type="text" name="firstName">

<br><br>

 Address:  &nbsp; <input type="text" name="address">

</form>


This will be a little messy for now, but you can make it look nicer later. You already
know how to center things, etc.



We can add a default value to the tags: 



<form name="myForm">

Name:  &nbsp; <input type="text" name="firstName" value="Joe">

<br><br>

 Address:  &nbsp; <input type="text" name="address" value="212 Main St">

</form>


Add 2 radio buttons (single-selectable button):



<form name="myForm">

Name:  &nbsp; <input type="text" name="firstName" value="Joe">

<br><br>

 Address:  &nbsp; <input type="text" name="address" value="212 Main St">
<br><br>

Have you visited this site before?
<br>
Yes <input type=radio name="visit" checked>
No <input type=radio name="visit">


</form>


Notice that the "checked" feature defaults that particular button to be selected.
In order for radio buttons to be used with each other, they MUST have the same
name.   Try this:

Yes <input type=radio name="visit" checked>
No <input type=radio name="visitedThisSite">

Notice that the functionality is lost. You click NO and now they are both selected.

Return them back to the previous state.

Use the "htmlTagList.doc" guide to figure out other input tags.



2 SELECT tags

Add a select box: (you need an end tag for this one)



<form name="myForm">

Name:  &nbsp; <input type="text" name="firstName" value="Joe">

<br><br>

 Address:  &nbsp; <input type="text" name="address" value="212 Main St">
<br><br>

Have you visited this site before?
<br>
Yes <input type=radio name="visit" checked>
No <input type=radio name="visit">

<br><br>
How did you find us?<br>
 <SELECT name="finder" >




</SELECT>





</form>


It doesn't look like much now, so let's add some options:


<br><br>
How did you find us?<br>
<SELECT name="finder" >

<option>Newspaper
<option>internet
<option>friend</option>


</SELECT>


Notice that you don't need the /option tag, but it's nice to put them in.


3 TEXTAREA tags

Let's add a textarea for comments:





<form name="myForm">

Name:  &nbsp; <input type="text" name="firstName" value="Joe">

<br><br>

 Address:  &nbsp; <input type="text" name="address" value="212 Main St">
<br><br>

Have you visited this site before?
<br>
Yes <input type=radio name="visit" checked>
No <input type=radio name="visit">


<br><br>
How did you find us?<br>
<SELECT name="finder" >

<option>Newspaper
<option>internet
<option>friend</option>


</SELECT>


<br><br>Comments:<br>
 <TEXTAREA ROWS=5 COLS=40></TEXTAREA>
        




</form>


......And that's a basic overview of forms. Use the "htmlTagList.doc" as a guide
in helping you learn the rest. 



#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*





By and large, forms are the most powerful html utility on the web. Unfortunately, 
you will not be able to experience the power of forms until you at least 
learn Javascript. With javascript, you can write some "smoke and mirror" code
which gives the appearence of functionality ordinarily not available with standard
HTML. The true power behind forms is when it is used in conjuction with 
server-side languages, such as JSP (Java Server Pages), ASP (Microsoft's Active 
Server Pages), PERL (also known as CGI), or PHP---and there are others, too.

With javascript, you can learn to set a "cookie" which can pass information on to
the next web page (such as Name, address, etc. which is contained in form fields).

With Server-side languages, you can use forms to send and recieve information and 
dynamically produce HTML code on-the-fly. (This is how search engines produce 
customized web pages according to your requests).

I am not going to discuss Javascript in this tutorial as it is a completely different
tutorial altogether. But, that doesn't mean you can't use javascript! You may not know
how it works, but you can "steal" code from other people's websites. It's not really
stealing because inherently all code on the web is free. Some people may not like 
you looking at their code but ultimately, they cannot prevent you from getting it since 
each and every webpage on the net that you view must first be downloaded to your local
machine, making it YOURS.  You may try to view people's source code, cut+paste code into
your own page (such as Javascript), and use the trial + error approach. Only do this
if you have a lot of time on your hands. Even experienced programmers such as myself
need reference manuals in order to get certain Javascript code to work. But there are 
many sites on the net which will give you step-by-step instructions on how to insert
pre-written Javascript into your page.  The best one I have ever found is
dynamicdrive.com    JavaBoutique.com and JavaFile.com are good sites for getting applets.


As far as server-side programming goes, you will never be able to learn it unless you
become a programmer (either from a college or job site).  Server side languages need 
special "servers" to run, therefore you could not run the code from your own PC.

But once you have become adept at "client-side programming", which is primarily HTML
and also Javascript, you can publish your page for free on the net! 

HOW???????

There are many sites that allow FREE web hosting. My personal favorite is angelfire.com
Go to the site and find the link for free web site domain hosting. You will have to fill
out a form, and follow the on-screen instructions. Soon you will be able to upload your
HTML files into your very own subdomain at angelfire. Then you will OFFICIALLY be on
the internet! For more information read Angelfire's FAQ page.

Questions, comments, concerns? Send feedback to: bmcwebdesign@hotmail.com







  





























