HTML Form: Creating a basic form

This entry is part 1 of 10 in the series HTML Form

A form can be placed anywhere in the body of an HTML document. A form is enclosed in a 2-sided <form> tag.

<form method='post'>


The method attribute specifies what will happen when the form is submitted.  We can use either post or get attribute.

Within the <form> tag, we can specify an action attribute.  This is typically an email or a script that will run when the user submits the form.

For an email delivery, it looks typically as below.

<form action='mailto:'>

This will trigger the default email to be launched in your PC.

To collect data from the form using a CGI script such as a php script, we use the following.

<form action=''>

You can refer to an earlier form that I have created using HTML and Javascript.

Try The Code
Series Navigation
HTML Form: Creating a text box >>