DREAM Theme park wants to automate its booking process so that the customer can book tickets for the theme park on the web.
To do this, the customer has to provide all his details along with the location of the theme park, date of visit, number of persons visiting the theme park. Also booking type needs to be entered. It can be either Normal or School or Corporate.
Create a Web page “Book Your Tickets” that has the below fields.
The code for designing the web page is provided partially. The text highlighted in bold needs to be implemented in the code to complete the web page design.
Note : All validations should be based on HTML 5 (Do not use Javascript)
Label Name
Component Name
Description
Customer Name
customerName
To enter the name of the customer.
The name should accept only alphabets and space.
The text “Enter your name” should be displayed by default in the text box. When the user starts entering the value, this text should disappear.
Address
Address
To enter the address of the customer.
Provide the correct tag and attribute to create a text area with 5 rows and 20 columns.
Email ID
customerEmail
To enter the email of the customer.
This field should accept a valid email.
Mobile Number
customerMobileNumber
To enter the mobile number.
The mobile number should accept only digits. It should contain 10 digits and start with 9/8/7.
Park Location
location
Select the Park location.
Provide the correct input type to make this component a radio button.
Date of Visit
dateofvisit
To select the date of visit.
Booking Type
bookingType
An auto-complete feature should be available to the user for the following options.
Normal, School, Corporate
(Name of the auto-complete feature should be “bookType”)
Fill the tag to implement the autocomplete feature.
Adult
adults
To enter the number of adults.
Provide the input type so that this field accepts only digits.
Set minimum value as 0 and maximum value as 500.
Children
children
To enter the number of children.
Provide the input type so that this field accepts only digits.
Book Now
submit
Clear
reset
Reset Button. On clicking this button, all fields should be reset.
Provide the input type for this component.
Use JavaScript for doing the below calculation:
Customer on entering the valid values and clicking the submit button the total amount has to be calculated based on the below assumptions :
Ticket cost of each Adult : Rs. 1500
Ticket cost of each Children : Rs. 1200
If Booking Type is Normal, no discount is provided.
If Booking Type is School, 50% discount is provided on the total ticket cost
If Booking Type is Corporate, 25% discount is provided on the total ticket cost
Hence Total cost = Total Ticket Cost - discount
The result needs to be displayed as “Thank you customerName. Total cost to be paid is ………” in a div tag with id “result”.
Note: Use getElementsByName or getElementById function to retrieve the values
Sample Webpage:
On providing the values the web page should look as follows :
Fill in the style tag so that the following styles are applied to the components as mentioned below.
(Do not use Inline CSS)
-
Body color should be “#FFAACC”.
-
The heading should be done using <h1> tag the text color should be “#770080”, font should be “Courier New”, style should be “italic” and it should be aligned to center of the webpage.
-
The result should be bold and color of the text should be #770080
The required partial code is provided in your Edit window. Delete / Remove the comments and replace with the correct code.
Note : Please don’t delete any of the code provided except the comments given in bold.