Monday, October 21, 2013

Filled Under:

How to create an html form

Hey every one how are you..
Today we will learn about forms.A form in html has the same meaning as any form which you fill out on paper.You can create your forms for your website such as a registration form etc.
To start with the basic you should know that the <form> tag is used to create an HTML form and when you are done creating a form your will have to close it as well using </form>

<html>
<body>

<form>
First name: <input type="text" name="firstname"><br><br>
Second name: <input type="text" name="secondname"><br><br>

<input type="submit" value="Submit">
</form>


</body>
</html>



So guys what i did above is i just gave 2 fields and a button to send the the data inserted into the fields to somewhere you want it to go.
First i wrote  the title for the fields so that the viewer of the form would know that this fields is for writing the first name or the second name.
Then i started by giving the type of input to be entered in the field which is "text",input data can be integer,float,char,string etc..
And then i gave a name to the field to be identified when you will have to insert it in the database table or to simply display it somewhere.
<br> tag stands for break line,it is used for giving a line space.
In the button I did the same,first i defined the type of input which is the submit,submit is used for submitting data to someplace.
Then i defined the value of the submit button. which will be displayed on the button as well.So this is how you create a form,further we will learn how to use check boxes,combo box,radio buttons and password in an HTML form.




0 comments:

Post a Comment