Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

jQuery Reservation app homework In this exercise, you will modify a Reservation

ID: 3597734 • Letter: J

Question

jQuery Reservation app homework

In this exercise, you will modify a Reservation application (see screenshots) to use Tabs, Datepicker, and Dialog widgets.

·       Open the HTML and JavaScript files below. Run this application to see what the user interface looks like.

·       Modify the HTML so that the contents of the three fieldset elements can be implemented as three tabs of a Tabs widget. After you do that, you can delete the fieldset and legend elements. Set the headings for the tabs to the content of the legend elements.

·       Add the jQuery code that implements the tabs.

·       Add the jQuery code that implements the Datepicker widget for the arrival date. The date can be from the current date to 90 days after the current date.

·       Code an event handler for the click event of the View Cancellation Policies button. This event handler should display the div element with an id of “dialog” as a modal Dialog widget.

_________________________________index.html______________________________________

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Reservation request</title>

<link rel="stylesheet" href="main.css">

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

</head>

<body>

<h1>Reservation Request</h1>

<form action="response.html" method="get"

name="reservation_form" id="reservation_form">

<fieldset>

<legend>General Information</legend>

<label for="arrival_date">Arrival date:</label>

<input type="text" name="arrival_date" id="arrival_date" autofocus>

<span>*</span><br>

<label for="nights">Nights:</label>

<input type="text" name="nights" id="nights">

<span>*</span><br>

<label>Adults:</label>

<select name="adults" id="adults">

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

</select><br>

<label>Children:</label>

<select name="children" id="children">

<option value="0">0</option>

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

</select><br>

</fieldset>

<fieldset>

<legend>Preferences</legend>

<label>Room type:</label>

<input type="radio" name="room" id="standard" class="left" checked>Standard&nbsp;&nbsp;&nbsp;

<input type="radio" name="room" id="business" class="left">Business&nbsp;&nbsp;&nbsp;

<input type="radio" name="room" id="suite" class="left last">Suite<br>

<label>Bed type:</label>

<input type="radio" name="bed" id="king" class="left" checked>King&nbsp;&nbsp;&nbsp;

<input type="radio" name="bed" id="double" class="left last">Double Double<br>

<input type="checkbox" name="smoking" id="smoking">Smoking<br>

</fieldset>

<fieldset>

<legend>Contact Information</legend>

<label for="name">Name:</label>

<input type="text" name="name" id="name">

<span>*</span><br>

<label for="email">Email:</label>

<input type="text" name="email" id="email">

<span>*</span><br>

<label for="phone">Phone:</label>

<input type="text" name="phone" id="phone" placeholder="999-999-9999">

<span>*</span><br>

</fieldset>

<input type="submit" id="submit" value="Submit Request"><br>

</form>

<script src="reservation.js"></script>

</body>

</html>

________________________________________________main.css______________________________

body {

font-family: Arial, Helvetica, sans-serif;

background-color: white;

margin: 0 auto;

width: 600px;

border: 3px solid blue;

padding: 10px 20px;

}

fieldset {

margin-top: 1em;

margin-bottom: 1em;

padding: .5em;

}

legend {

color: blue;

font-weight: bold;

font-size: 85%;

margin-bottom: .5em;

}

label {

float: left;

width: 90px;

}

input, select {

margin-left: 1em;

margin-right: 1em;

margin-bottom: .5em;

}

input {

width: 14em;

}

input.left {

width: 1em;

padding-left: 0;

}

p {

margin-top: 0;

margin-bottom: .5em;

}

input.last {

margin-bottom: 1em;

}

#adults, #children {

width: 35px;

}

#smoking {

width: 1em;

margin-left: 0;

}

#submit {

margin-left: 0;

width: 10em;

}

span {

color: red;

}

___________________________________________response.html_____________________________

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Reservation Request</title>

<style>

body {

font-family: Arial, Helvetica, sans-serif;

background-color: white;

margin: 0 auto;

width: 600px;

border: 3px solid blue;

padding: 20px;

}

</style>

</head>

<body>

<main>

<h3>Thank you for your request!</h3>

<p>We will contact you within the next 24 hours.</p>

</main>

</body>

</html>

_____________________________reservation.js_________script_____________________

$(document).ready(function() {

var emailPattern = /[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}/;

}); // end ready

Reservation Request General Information Preferences Contact Information Arrival date: Nights: Adults: Children: View Cancellation Policies Submit Request

Explanation / Answer

!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Reservation request</title>

<link rel="stylesheet" href="main.css">

<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

</head>

<body>

<h1>Reservation Request</h1>

<form action="response.html" method="get"

name="reservation_form" id="reservation_form">

<fieldset>

<legend>General Information</legend>

<label for="arrival_date">Arrival date:</label>

<input type="text" name="arrival_date" id="arrival_date" autofocus>

<span>*</span><br>

<label for="nights">Nights:</label>

<input type="text" name="nights" id="nights">

<span>*</span><br>

<label>Adults:</label>

<select name="adults" id="adults">

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

</select><br>

<label>Children:</label>

<select name="children" id="children">

<option value="0">0</option>

<option value="1">1</option>

<option value="2">2</option>

<option value="3">3</option>

<option value="4">4</option>

</select><br>

</fieldset>

<fieldset>

<legend>Preferences</legend>

<label>Room type:</label>

<input type="radio" name="room" id="standard" class="left" checked>Standard&nbsp;&nbsp;&nbsp;

<input type="radio" name="room" id="business" class="left">Business&nbsp;&nbsp;&nbsp;

<input type="radio" name="room" id="suite" class="left last">Suite<br>

<label>Bed type:</label>

<input type="radio" name="bed" id="king" class="left" checked>King&nbsp;&nbsp;&nbsp;

<input type="radio" name="bed" id="double" class="left last">Double Double<br>

<input type="checkbox" name="smoking" id="smoking">Smoking<br>

</fieldset>

<fieldset>

<legend>Contact Information</legend>

<label for="name">Name:</label>

<input type="text" name="name" id="name">

<span>*</span><br>

<label for="email">Email:</label>

<input type="text" name="email" id="email">

<span>*</span><br>

<label for="phone">Phone:</label>

<input type="text" name="phone" id="phone" placeholder="999-999-9999">

<span>*</span><br>

</fieldset>

<input type="submit" id="submit" value="Submit Request"><br>

</form>

<script src="reservation.js"></script>

</body>

</html>