A form is simply an HTML element designed to get data from a user.
You use a form everytime you login. Here is an example of such a form:
You should be able to pick out the code for each element but this Coding Block will take you through each type of element and how they work.
As you can see above, the HTML Form Element is made up like all other HTML elements using a tag, in
this case the tag is form
. It has the following properties:
styles.css
id property
. This is so that it can be identified and used by
the JS/jQuery codeinput elements
for getting input from the user. There
are many types that you will have used and we will go through later on.button element
. This is so that the act
of submitting the
form can be captured. There are many ways to do this but you will be shown a particular way that
provides the greatest control over the action.Remember that an input element is something that a user interacts with to provide the program with data or to enable a particular action to be carried out.
A form can be made from a variety of different input elements and this coding block will look at some of the basic input elements:
As already mentioned, this includes the entry of numbers - in fact it covers all possible ASCII and Unicode characters.
You can see that the input element
has a type. This type can be set to many values but
some of them are:
You can find more input types here
These inut elements provide a list of choices.
You can see that the input element
has a type. This type can be set to many values but
some of them are:
This video goes through the modelling on this page: