Question

Create a page with a form for reserving a rental car. As a user creates a reservation, store cook...

Create a page with a form for reserving a rental car. As a user creates a reservation, store cookies containing the user’s reservation information, including name, address, telephone, pickup and return dates, and car type. Also display a user’s reservation information with an alert message. Set the cookies so that they expire one day after a visit. Save the page as rent.html

0 0
Add a comment Improve this question Transcribed image text
Answer #1

<!DOCTYPE html>
<html>
<head>   
<script type = "text/javascript">

function WriteCookie() {

  
  
               var date = new Date();
               date.setTime(+ date + (24 * 3600000)); //60 * 60 * 1000

              
           cookievalue=escape(document.myform.ReturnDate.value)+";";
cookievalue = escape(document.myform.Name.value) + ";" +escape(document.myform.Address.value)+";"+escape(document.myform.Telephone.value) + ";" +escape(document.myform.Pickup.value)+";"+escape(document.myform.ReturnDate.value) + ";" +escape(document.myform.CarType.value)+";";
             
document.cookie = "name=" + cookievalue;
               document.cookie = " expires=" + date.toGMTString() + ";";

           alert("Car Reserved");
}
  
</script>
</head>

<body>
<form name ="myform" action = "">
Enter name: <input type = "text" name = "Name"/><br>
       Enter address: <input type = "text" name = "Address"/><br>
       Enter telephone: <input type = "text" name = "Telephone"/><br>
       Enter pickup: <input type = "text" name = "Pickup"/><br>
       Enter returnDate: <input type="date" name="ReturnDate"><br>
       Enter carType: <input type = "text" name = "CarType"/><br>
         
<input type = "button" value = "Reserve" onclick = "WriteCookie();"/>
</form>   
</body>
</html>

Add a comment
Know the answer?
Add Answer to:
Create a page with a form for reserving a rental car. As a user creates a reservation, store cook...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a modular program using structured programming to store the amount of money a local store...

    Create a modular program using structured programming to store the amount of money a local store made in sales for each day of the past week. The user will be given the option to enter an amount for the next day, compute the average, find the highest amount, find the lowest amount, or print all the information including the daily sales with the average, highest, and lowest amount. When the user chooses an option to enter an amount for the...

  • HTML / CSS Content Requirements Create a home page with the following elements and settings: Set...

    HTML / CSS Content Requirements Create a home page with the following elements and settings: Set the background, font colors, and “theme” to match those used in lab assignment #1 using an external css file; inline styling should be used only where necessary to override styling from the external css H1 element, centered at the top of the page, with “Thank you for choosing Your Company Name. . . “ text* Div or other container with at least 5 sentences...

  • Create an HTML5 page that contains a form to collect the following data. The text in...

    Create an HTML5 page that contains a form to collect the following data. The text in bold indicates the id value that should be assigned to each html control: Product (drop down list) product – iPad, iPhone 6S, Galaxy 5S, Moto X, and so on Quantity (number) quantity Unit price (number) unit_price Discount (%)(number) discount_rate Date (date)   order_date First Name (text box)   first_name Last Name (text box)   last_name Payment type (drop down list)   payment_type – Visa, Master, Discover, Amex, and...

  • C++ : Please include complete source code in answer This program will have names and addresses...

    C++ : Please include complete source code in answer This program will have names and addresses saved in a linked list. In addition, a birthday and anniversary date will be saved with each record. When the program is run, it will search for a birthday or an anniversary using the current date to compare with the saved date. It will then generate the appropriate card message. Because this will be an interactive system, your program should begin by displaying a...

  • Activity: Writing Classes Page 1 of 10 Terminology attribute / state behavior class method header class...

    Activity: Writing Classes Page 1 of 10 Terminology attribute / state behavior class method header class header instance variable UML class diagram encapsulation client visibility (or access) modifier accessor method mutator method calling method method declaration method invocation return statement parameters constructor Goals By the end of this activity you should be able to do the following: > Create a class with methods that accept parameters and return a value Understand the constructor and the toString method of a class...

  • The following are screen grabs of the provided files Thanks so much for your help, and have a n...

    The following are screen grabs of the provided files Thanks so much for your help, and have a nice day! My Java Programming Teacher Gave me this for practice before the exam, butI can't get it to work, and I need a working version to discuss with my teacher ASAP, and I would like to sleep at some point before the exam. Please Help TEST QUESTION 5: Tamagotchi For this question, you will write a number of classes that you...

  • 13.7 please 13.7 Table 13.3 (page 602) identifies three risks typically encountered when updating the general ledger Required (a) Analyse the degree of exposure to each of these risks for...

    13.7 please 13.7 Table 13.3 (page 602) identifies three risks typically encountered when updating the general ledger Required (a) Analyse the degree of exposure to each of these risks for the update the general ledger process at AB Hi-Fi. update general ledger process at AB Hi-Fi. the update the general ledger process is, and how comprehensive the current internal (b) Determine how many of the common controls described in table 13.3 are present in the (c) Prepare a short report...

  • 23. What is the total net amount of capital gain reported on Form 1040? OA. $308...

    23. What is the total net amount of capital gain reported on Form 1040? OA. $308 OB. $2,411 C. $2,719 OD. $2,900 Advanced Scenario 7: Mark and Barbara Matthews Directions Using the tax software, complete the tax return, including Form 1040 and all appropri- ate forms, schedules, or worksheets. Answer the questions following the scenario. Note: When entering Social Security numbers (SSNs) or Employer Identification Numbers (EINS), replace the Xs as directed, or with any four digits of your choice....

  • Read the case study "Google, Apple, and Facebook Struggle for Your Internet Experience" on page 255....

    Read the case study "Google, Apple, and Facebook Struggle for Your Internet Experience" on page 255. Then discuss the advantages and disadvantages for each company. BUSINESS PROBLEM-SOLVING CASE Google, Apple, and Facebook Battle for Your Internet Experience Apple has a legacy of innovation on its side. In Three Internet titans Google, Apple, and 2011, it unveiled the potentially market disrupting Facebook are in an epic struggle to dominate your Siri (Speech Interpretation and Recognition Internet experience, and caught in the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT