HTML and CSS Reference
In-Depth Information
8.
Create a new
<div>
element that has an
<input>
element with the type
text
and the name and ID
restaurant
. You should also create a label for this input.
<div class=”field”>
<label for=”restaurant”>Restaurant:</label>
<input type=”text” name=”restaurant” id=”restaurant”>
</div>
9.
Create another new
<div>
element with an
<input>
that has the type
text
and the name and ID
bookingTime
. Don't forget the label!
<div class=”field”>
<label for=”bookingTime”>Booking Time:</label>
<input type=”text” name=”bookingTime” id=”bookingTime”>
</div>
10.
Create a
<div>
element with an
<input>
that has the type
text
and the name and ID
guests
. Add a
label for this input.
<div class=”field”>
<label for=”guests”>Number of Guests:</label>
<input type=”text” name=”guests” id=” guests”>
</div>
11.
Create a final
<div>
element with an
<input>
element. This time set the type to
checkbox
and the
name and ID to
marketing
. Set the
value
attribute to 1. Then create a label for this element with the
text shown in the following code.
<div class=”field”>
<label for=”marketing”>Please tick this box if you would like to receive
special offers from Joe's Pizza Co.</label>
<input type=”checkbox” name=”marketing” id=”marketing” value=”1”>
</div>
12.
Save the
bookings.html
file.
Here is how your
<form>
element should now look:
<form action=”bookings.php” method=”POST”>
<div class=”field”>
<label for=”name”>Name:</label>
<input type=”text” name=”name” id=”name”>
</div>
<div class=”field”>
<label for=”phone”>Phone:</label>
<input type=”text” name=”phone” id=”phone”>
</div>
<div class=”field”>
<label for=”email”>Email:</label>
<input type=”text” name=”email” id=”email”>
</div>
<div class=”field”>
<label for=”restaurant”>Restaurant:</label>
<input type=”text” name=”restaurant” id=”restaurant”>