How to create a form on your website using HTML
There are several types of form controls that
you can use to collect information from visitors
to your site.
ADDING TEXT:
1.
3.
And Butons
Lets start to learn how to make these stuf in HTML
Result
form
Form controls live inside a
<form> element. This element
should always carry the action
attribute and will usually have a
method and id attribute too.
.
action
Every <form> element requires
an action attribute. Its value
is the URL for the page on the
server that will receive the
information in the form when it
is submitted
method
Forms can be sent using one of
two methods: get or post.
With the Get method, the values
from the form are added to
the end of the URL specified in
the action attribute. The get
method is ideal for:
●● short forms (such as search
boxes)
●● when you are just retrieving
data from the web server
(not sending information that
should be added to or deleted
from a database)
<form action="http://www.example.com/subscribe.php"
method="get">
<p>This is where the form controls will appear.
</p>
</form>
With the post method the
values are sent in what are
known as HTTP headers. As a
rule of thumb you should use the
post method if your form:
●● allows users to upload a file
●● is very long
●● contains sensitive data
(e.g. passwords)
●● adds information to, or
deletes information from, a
database
If the method attribute is not
used, the form data will be sent
using the get method.
id
ID value is used to
identify the form distinctly from
other elements on the page (and
is often used by scripts — such
as those that check you have
entered information into fields