The <input>
tag is the most important field in the forms.
The main attribute is type =" "
, the latter will determine how
the field will be displayed:
text
- single line text field (default)number
- entry of a numberemail
- entry of an email addressdate
: - entry of a datepassword
- entry of a passwordcolor
- selection of a colorrange
- numerical value between two terminals (slider)submit
- form submit buttonThe name attribute specifies the name of the field which must be unique. It is this name that will serve as an identifier for the processing script. For example, data from field
<input type="text" name="city">
will be posted in the PHP variables $_POST['city']
ou $_GET['city']
.
The value=""
specify the default value that will be displayed in the
field when the page will be loaded :
<input type="text" name="city" value="Paris">
displays:
The placeholder=""
attribute displays a message or an example for the user
that will be automaticaly deleted as soon as the user enter the first character
in the field:
<input type="text" name="city" placeholder="Enter your city">
displays:
Write the HTML code to display an identification form (email and password) according to the following example:
In the file process.php
, check that received data are
pierre@gmail.com
for the email and abcdef
for the password:
You are connected
Invalid email or password