Skip to main content

HTML Tutorial 5: Basic Elements on An HTML Form (Part 1)



Basic Elements on An HTML From


Few months ago, I started writing about HTML. There are already 4 tutorials published on HTML. I know this is not sufficient for an HTML learner. Because learning HTML requires much resources and practice. However I will try to write about HTML whenever I'm able to manage time. 

You can also read the previously published HTML Tutorial:

Today's HTML tutorial is very easy, funny and useful. Today I will discuss about the basic elements of an HTML form. This is the part 1 that includes Text Fields, Password Field, Radio Buttons & Checkboxes. 



How to Start: 

You can practice using notepad. Press Start + R > Type Notepad > Enter. Now copy or type the code from here. And save them as form.htm or use any other name. But the name should end with either .htm or .html. Then open the file in a browser. 


Let's begin - 

Usually an HTML form contains input elements like text fields, checkboxes, radio buttons, submit buttons etc. To create an HTML form you must use the <form> tag. Look at the structure below:

<form>

input elements

</form> 

Though you skip the <form> tag, modern browsers can identify your form. But this is a basic rule for creating html forms. So you should start with <form> and end with </form>. 




Text Fields:

<input type="text"> indicates a one-line input field to enter text. 

<form>
First name: <input type=text><br>
Last name: <input type=text>
</form>
The result will be as below: 


First name:

Last name:
Note: <br> tag is used to create line break. Otherwise both fields will appear in a single line. The default width of a text field is 20 character. You can increase it as below: 


<form>Name: <input type=text size = 40><form>

The result will be: 

Name:




Password Field:

<input type="password"> defines a password field. Whenever someone types in a password field, the characters are shown as circles. 

<form>
Password: <input type=password>
</form>

The result will be: 

Password:


Radio Buttons:

<input type="radio"> refers to a radio button. Radio button allows user to choose a single item. After selecting an item, you can change it. But once selected, you can't undone it. 

<form>Which one do you like most?<input type=radio name=Mobile>Nokia<br><input type=radio name=Mobile>Samsung<br><input type=radio name=Mobile>Apple</form>

You will get:  

Which one do you like most?

Nokia

Samsung

Apple



Checkboxes:

<input type="checkbox"> defines a checkbox. Somewhat similar to radio buttons. But here an user can choose multiple items. And he can deselect the item any time! 

<form>

What is your Favorite Browser?

<input type=checkbox>Google Chrome<br>
<input type=checkbox>Firefox<br>
<input type=checkbox>Internet Explorer<br>
<input type=checkbox>Opera<br>
<input type=checkbox>Other<br>
</form>
Your browser will show: 

What is your Favorite Browser?

Google Chrome

Firefox

Internet Explorer

Opera

Other

These are some important elements of an HTML form. There are few other elements remaining. I will try to write about those elements in the next post. And then I'll put these all together and show you how to prepare an HTML form. Till then, stay with us . . . 


Stay with Marks PC Solution to get more interesting IT topics!


Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete

Post a Comment

Popular posts from this blog

GTA San Andreas Cheat Code (PDF)

After Vice City, San Andreas is the most popular game released by Grand Theft Auto (GTA). Usually GTA releases role playing game. San Andreas is such a game where you can act like a person. You can do everything. You have to take part in missions and complete them.  To make your missions easier, there are lots of cheat codes. If you can properly apply these codes, the tough parts of the game will be easier. Cheat codes are somewhat like keyboard shortcuts of computer programs.  I've shared 63 cheat codes below. There were more cheat codes in my collection, but I've omitted the less important cheats. Effects or result of the cheats are on the left side, and the codes are on the right side.  You can copy the following codes in your PC. And for your convenience, I've also uploaded a PDF file of these codes. You will find the download link at the bottom.  Effect Cheat Code Adrenaline Mode MUNASEF All Cars Explode ALL...

Rules for Bengali Typing in PDF (Bijoy Layout)

Bijoy is the most popular layout for Bangla typing. The layout was developed by Mostafa Jabbar. He is the pioneer of Bangla typing in computer. More than 90% people use his Bijoy layout for Bangla typing. Today, I'm gonna share a PDF file with you that contains the Bijoy Keyboard layout with English fonts! If your keyboard doesn't have bengali fonts then you can print this PDF file to know where the bengali fonts are located in your keyboard. Additionally this file contains all the necessary rules and tips which are essential for Bangla Typing.  Now there are many other software available for Bangla Typing Layout. Such as Avro Easy, Unicode, Unibijoy etc. And there rules are also somewhat different from Bijoy. And some of their layouts follow the same rules like Bijoy. Hopefully this PDF file will support most of the rules when a layout is similar to Bijoy Layout.  Click to enlarge the image Download the PDF file from the button below. Follow...

Office 2016 Activator (KMSPico 10.1.5)

It's been couple of months after the release of final version of Microsoft Office 2016. And maybe you're tired of finding for a working activator for this version. Today I'm gonna share Office 2016 activator with you - no more waiting!! About the Activator   Name: KMSPico 10.1.5 File Size: 3 MB (Approx) File Type: Zipped Folder 100% Neat & Clean - No virus! Activating Capacity . . . KMSPico 10.1.5 is successfully leading the KMS world for last few months. If everything is okay, success rate is 100%. This tool has been tested and verified by Marks PC Solution. With this tool, you can activate -  Office 2016, 2013 & 2010 Windows 10, 8.1 & 8 Hopefully this version will work for both 32 bit & 64 bit versions of Windows. Installing Office 2016 Collect/ Download Office 2016 Professional Plus from Microsoft or somewhere else. Install it as trial version without any key. Use the follow...