Forms in html

In this article we are going to learn about forms in html.

We learnt about html, text in html, lists in html, links in html, inputs in html and buttons in html so, now we are going to learn about forms.

Forms

Forms are used in html for users to register online on the website, can also be used to contact companies through online and loging in on websites and applications.

Forms are used with the help of inputs to get users details during registrations, logins and contacting companies online on websites and applications.

Let us create a simple form, copy and paste below code.

<form>

<label>First Name:</label>

<div>

<input type="text"/>

<input type="button" value="submit"/>

</div>

</form>

So, we should have the following results.

We have created a form with fisrt name input field and submit button. So, a form must have input fields to collect users' information then the submit or send button for the user to submit the form when clicked.

Let us create form with more than one fields, copy and paste below code.

<form>

<label>First Name:</label>

<div>

<input type="text"/>

</div>

<label>Last Name:</label>

<div>

<input type="text"/>

</div>

<button type="submit">submit</button>

</form>

So, we should have the following results.

We created a form with two fields, first and last name input fields that a user can fill and then click submit button to send the form to the receiver. Bear in mind that the forms cannot be send to the receiver with just html only, but we must intergrate the form with a programming language like php.


Conclusion

In this article we learnt about forms in html with examples and how to create forms that collect user data using input fields and how the data is submitted to the receiver.