Cheap Web Hosting Directory
 
Menu

Website Hosting
Windows / NT Hosting
Linux / Unix Hosting
E-Commerce Hosting
Dedicated Servers
PHP / MySql Hosting
Managed Hosting
Domain Registrar
Reseller Hosting
FrontPage Extension
Co-location Hosting
ASP / ASP.Net Hosting
Shared Hosting

Compare Hosting
Unix Hosts
Windows Hosts

Features
WebHosting Articles
WebHosting Specials
WebHosting Reviews
WebHosting News
HTML Tutorial
Free Software
Glossary & Terms

Site Information
Link To Us
Privacy Policy
Contact Us


Popular Hosts


HTML Tutorial

Chapter 13: Forms

Forms...

Forms allow you to add interactivity to your web documents by way of the <FORM> tag. With the form tag you can add to your web pages a guestbook, order forms, surveys, get feedback or whatever.

The basic construction of a html form is this...

  <FORM>    begin a form
  <INPUT>   ask for information in one of several different ways...
  <INPUT>   ...there can be as many input areas as you wish
  </FORM>   end a form


The <INPUT> tag provides the user with various ways of inputting information. There are several different <INPUT> tags.

Form Input...

Text

The most common TYPE of form <INPUT> is TEXT.

<INPUT TYPE=TEXT>


Every input needs a NAME.

<INPUT TYPE=TEXT NAME="ADDRESS">

When the user types in his address (for example 1313 Mockingbird Lane), it will become the input's value and be paired with ADDRESS so the end result after running it through Mailto Formatter will be ADDRESS=1313 Mockingbird Lane.


We can if we want, type in a VALUE.

<INPUT TYPE=TEXT NAME="ADDRESS" VALUE="44 Cherry St">

This will automatically pair the value 44 Cherry St with the name ADDRESS, unless the user changes it. Note- be sure to use quotes where I've specified.


We can specify the size of the text input box.

<INPUT TYPE=TEXT NAME="ADDRESS" VALUE="44 Cherry St" SIZE=10>

<INPUT TYPE=TEXT NAME="ADDRESS" VALUE="44 Cherry St" SIZE=20>

<INPUT TYPE=TEXT NAME="ADDRESS" VALUE="44 Cherry St" SIZE=30>

The default value is 20.


If we want, we can specify how many characters a user can input.
Go ahead and try to input more than 10 characters in the text box below:

<INPUT TYPE=TEXT NAME="ADDRESS" SIZE=30 MAXLENGTH=10>


Very similar to the TYPE=TEXT is the TYPE=PASSWORD. It is exactly the same, except it dispays *** instead of the actual input. The browser will send you the input, it just won't display it.

<INPUT TYPE=PASSWORD>


Remember that each <INPUT> must have a NAME.

<INPUT TYPE=PASSWORD NAME="USER PASSWORD">

SIZE, VALUE, and MAXLENGTH modifiers/attributes work here also. By the way, a <TAG> tells the browser to do something.


Radio Buttons and Check Boxes

Radio buttons allow the user to choose one of several options. Check Boxes allow the user to choose one or more or all of the options.
First let's build some Radio Buttons.

<INPUT TYPE=RADIO NAME="POSITION">


Now add 2 more.

<INPUT TYPE=RADIO NAME="POSITION">
<INPUT TYPE=RADIO NAME="POSITION">
<INPUT TYPE=RADIO NAME="POSITION">

Hmmm... I suppose we should put a line break after each one.


<INPUT TYPE=RADIO NAME="POSITION"><BR>
<INPUT TYPE=RADIO NAME="POSITION"><BR>
<INPUT TYPE=RADIO NAME="POSITION"><P>



Note that each input has the same name. The reason will become apparent very shortly.


Each of the Radio Buttons must be assigned a VALUE.

<INPUT TYPE=RADIO NAME="POSITION" VALUE="PB"><BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="DBA"><BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="NOTA"><P>




Now label each button.

<INPUT TYPE=RADIO NAME="POSITION" VALUE="PB"> Powerbuilder Developer<BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="DBA"> Database Administrator<BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="NOTA"> None of the above<P>

Powerbuilder Developer
Database Administrator
None of the above

You can also modify these labels with other html tags if you wish.


Essentially your Radio Buttons are done. You can tidy things up by adding a statement above the buttons, and if you want, choose a default selection (optional).

What is your position within the company?<BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="PB" CHECKED> Powerbuilder Developer<BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="DBA"> Database Administrator<BR>
<INPUT TYPE=RADIO NAME="POSITION" VALUE="NOTA"> None of the above<P>

What is your position within the company?
Powerbuilder Developer
Database Administrator
None of the above

The user of course can only choose 1 option. Their choice will be returned to you as the name/value pair POSITION=PB (or whichever they pick).


Building Check Boxes is pretty much the same thing. Start with this.

<INPUT TYPE=CHECKBOX NAME="PB">


Add 3 more, but this time give each one a different NAME. (Also add in line breaks if you want)

<INPUT TYPE=CHECKBOX NAME="PB"><BR>
<INPUT TYPE=CHECKBOX NAME="DBA"><BR>
<INPUT TYPE=CHECKBOX NAME="NOTA"><BR>




Each Check Box gets the same VALUE.

<INPUT TYPE=CHECKBOX NAME="PB" VALUE="YES"><BR>
<INPUT TYPE=CHECKBOX NAME="DBA" VALUE="YES"><BR>
<INPUT TYPE=CHECKBOX NAME="NOTA" VALUE="YES"><BR>



Note- For Check Boxes the NAME changes and the VALUE stays the same and with Radio Buttons, the VALUE changes but the NAME stays the same. Don't feel bad, my simple mind still gets confused.


OK, let's label each box.

<INPUT TYPE=CHECKBOX NAME="PB" VALUE="YES"> Powerbuilder Developer<BR>
<INPUT TYPE=CHECKBOX NAME="DBA" VALUE="YES"> Database Administrator<BR>
<INPUT TYPE=CHECKBOX NAME="NOTA" VALUE="YES"> None of the above<BR>

Powerbuilder Developer
Database Administrator
None of the above


And lastly, you may want to add a little something above your check boxes and maybe pick a couple defaults.

What positions do you occupy within the company?<BR>
<INPUT TYPE=CHECKBOX NAME="PB" VALUE="YES" CHECKED> Powerbuilder Developer<BR>
<INPUT TYPE=CHECKBOX NAME="DBA" VALUE="YES" CHECKED> Database Administrator<BR>
<INPUT TYPE=CHECKBOX NAME="NOTA" VALUE="YES"> None of the above<BR>

What positions do you occupy within the company?
Powerbuilder Developer
Database Administrator
None of the above

The user can choose 1, 2, none or all of the options. Their choices will be returned to you as the name/value pairs...

PB=YES
DBA=YES
(or what ever they choose... if they choose nothing, nothing will be returned to you)




Your own HTML page...

We will now construct the feedback page we created in Chapter 11. Open the blank page "feedback.htm" in Notepad, and add the following (the blue text is what to add).

<html>
<body background="bgnd.gif" bgcolor=#FFFFFF>

<center><h1>Feedback Form</h1></center>
<br>
<form>
<b>My name is: </b><input type=text name="name">
<p>
<b>I work as a:</b><br>
<input type=radio name="position" value="Developer" checked>Developer<br>
<input type=radio name="position" value="ProjMan">Project Manager<br>
<input type=radio name="position" value="TechMan">Technical Manager<br>
<input type=radio name="position" value="NOTA">None of the above
</p>
<p>
<b>When it comes to web browsers:</b><br>
<input type=checkbox name="Netscape" checked>I use Netscape Navigator<br>
&nbsp;&nbsp;<input type=radio name="NetscapeVer" value="2.0">version 2.0<br>
&nbsp;&nbsp;<input type=radio name="NetscapeVer" value="3.0" checked>version 3.0<br>
<input type=checkbox name="IExplorer">I use Microsoft Internet Explorer<br>
&nbsp;&nbsp;<input type=radio name="IEVer" value="2.0">version 2.0<br>
&nbsp;&nbsp;<input type=radio name="IEVer" value="3.0">version 3.0<br>
</p>

</body>
</html>


Save the file.

Go To Chapter 14

Most Popular Hosting Companies
   

Don't let expensive hosts eat your profits!

Lunarpages is dedicated to taking your web hosting needs to the next level. Because our focus is foremost on providing you with high quality service and accountability, you can depend on us to always be there for you.

 

Tired of bouncing from host to host? We offer 24/7/365 phone support, 99.9% uptime, and have a 30 day money back guarantee. Your site will be on a top of the line Dual Xeon server that provides INSTANT backups of your site. Our control panel is one of the best in the industry, and has over 39 scripts that can be installed with a click of the mouse.
 

Bluehost Web Hosting $6.95

Our Professional Web Hosting plans include: 1 Gigabyte Hosting Space; 1,000 POP Email Accounts; 50 GIGS of Transfer; SSL, FTP, Stats; CGI, PHP, MySQ; 2000/2002/2003 Front Page Extensions; Free Domain Included; Toll Free Support

 

Get 20,000 MB of space and 400 GB of transfer includes MIVA Merchant 5 storefront software. Other features include Host 20 seperate websites, 24x7 LIVE support, Urchin web statistics, free website builder, spam & virus protection.

 

Easy CGI Web Hosting

$7.96 per month, Perl, PHP and ASP Support, FrontPage 2002 Extensions, MS Access, MySQL, MSSQL, Hosting Control Panel, ColdFusion, WebTrends Traffic Reports, Shared SSL Access etc. At Easy CGI we maintain our own Data Center located in the same building as our corporate headquarters. This allows us to quickly assess and resolve any problems that may occur and monitor our systems to the highest degree to keep our network running at 100%.


News and Articles

 

  Latest News

©

  Latest Articles
 


Sprint To Participate in Upcoming Financial Conferences
Sprint (www.sprint.com) today announced it will participate in the following upcoming conferences ...

Cisco Systems to Acquire FineGround
Cisco Systems today announced a definitive agreement to acquire privately-held FineGround ...

HP and Bank of India Win IT Outsourcing Award
HP and Bank of India today announced that the companies' IT outsourcing engagement has been ...

More News


Switching Web Host
Moving a web site to a new host is not as difficult as you may think. ...

Linux vs. Windows Web Hosting, Does It Make A Difference?
One of the most confusing decisions someone new to web hosting will have to make is which platform ...

Reseller Web Hosting - A Cheaper Alternative?
There comes a time when the internet bug hits us all and we tend to acquire a wealth of domain ...

More Articles


Popular Hosts
250GB Space and 2500GB Transf for $6.95 a month!


Copyright ©2008 BEtheNet.com