Basic HTML forms for beginnersHome page Basic html html tables Text and font tags Image tags JavaScript Free Tracking Website hosting Html Forms for the beginner and first time webmasters. Explained on this page are the submit button - reset button - text field - radio buttons - checkboxes - password field. To find the cgi or java script instructions for the action attributes and method get and post attributes check your web site host. Basic form rules :
Each set of form tags must be independent from each other This is one set of form tags <form></form> The password field by itself only hides the text on the users screen A secure link between the browser and server is a seperate matter This puts text on a single line until the enter key is pressed Here we will be looking at the html elements handled in your browser When you are using forms on your website you will need to find the cgi or java script instructions for the action attributes and method get and post attributes for your server. They are usually on your server site or you can contact your server webmaster. Visit www.w3c.org The World Wide Web Consortium |
||
| A very basic HTML form | The HTML Code to put the form on your site | |
|
|
<form action="W" method="X"> <input name="Y" type="text" value="Enter e-mail address"> <button name="senddata" type="submit">Submit</button> </form> | |
For the above example on your web site:
|
||
|
|
||
| Simple form layout | The HTML Code for the form layout view on the left | |
|
My web server uses |
My web server uses
<br><br> <form> <input name="host" type="radio" value="linux">Linux <input name="host" type="radio" value="unix">Unix <input name="host" type="radio" value="apache">Apache <input name="host" type="radio" value="other">Other <br><br> The internet browsers I use are <br><br> <input name="ie" type="radio" value="iexplorer">Iexplorer <input name="nn" type="radio" value="netscape">Netscape <input name="ff" type="radio" value="fire fox">Fire fox <input name="ob" type="radio" value="other">Other <br><br> <button name="senddata" type="submit">Submit</button> <button name="cleardata" type="reset">Reset</button> </form> | |
|
Note that in the example form above you can only select one radio button in the first row. This is a property of radio buttons selecting any button in a group deselects all other radio buttons in that group. You assign groups using the input name value "host" is used in this example. Use names that will relate to your question and make sense in your form report. The second row uses a different name value for each button and you can select all the radio buttons in the second row. | ||
| Basic HTML password form | The HTML password form code | |
|
|
<form action="W" method="post"> <input name="ID" type="text" value=" " size="8" maxlength="8">User ID <br> <input name="pass" type="password" value=" " size="8" maxlength="8">Password <br> <button name="senddata" type="submit">Login</button> </form> | |
For the above example:
The password field by itself only hides the text on the users screen |
||
| Basic HTML drop-down form | The HTML drop-down form code | |
|
|
<form> What would you like most in a web host ? <select name="mydropdown"> <option>Cheap web hosting</option> <option>High band width</option> <option>FTP file access</option> </select> </form> | |