Question: HTML with JavaScript code needed Uses an html form (not a prompt box) that will connect to JavaScript through the use of the HTML onclick

HTML with JavaScript code needed

Uses an html form (not a prompt box) that will connect to JavaScript through the use of the HTML onclick event attribute used in the Submit button element in the form.

Create a Web page that will display the name of a movie theatre, the price of an adult ticket, and the price of a child's ticket.

Your Web Page will use a html "form" (not a prompt box) to obtain from the user their name and the number of adult and children tickets needed to purchase.

Your Submit button, in the form, will use the onclick event handler to call a JavaScript function ( the JavaScript function called in this example is named "displayOrder()").

This function will use the input entered in the FORM to determine the total cost of adult tickets, the total cost of children tickets, and the total of the entire purchase (adult cost + children cost).

Your program will display, in a read-only text box (located in the FORM): the user's name, the number of adult and children tickets entered by the user, the total cost for the adult tickets, the total cost for the children tickets, and the total final cost (adult cost + children cost)

(the displayOrder function is defined within the head tags of the web page- it is called into use when the Submit button is clicked and the onclick event handler activated).

These last 3 numbers should be displayed with a $ and 2 decimal places (use the toFixed(2) function)

Save the file as TicketSales.html. Submit only the actual HTML and JavaScript code in the html file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!