From 8cedfd3f435bd81b9bab1813c431b20e503668e9 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 10 Nov 2015 09:51:53 -0500 Subject: [PATCH] Added warning if property not selected --- js/app.js | 11 +++++------ js/custom/pageSetup.js | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/js/app.js b/js/app.js index 0992dea..0a85894 100644 --- a/js/app.js +++ b/js/app.js @@ -52,7 +52,7 @@ $(document).ready(function () { } y = currentDate.getFullYear(); requiredDate = y + '-' + m + '-' + d; - + start = "arrival_date=" + y + '-' + m + '-' + d + '&'; if (requiredDate < $('#arriveOff').attr("min")) { minDays = $('#arriveOff').attr("min"); $("#arriveOff").val(minDays); @@ -67,7 +67,6 @@ $(document).ready(function () { m = '0' + m; } y = currentDate.getFullYear(); - start = "arrival_date=" + y + '-' + m + '-' + d + '&'; requiredDate = y + '-' + m + '-' + d; arrival = d + '-' + m + '-' + y; arrival.toString(); @@ -99,7 +98,6 @@ $(document).ready(function () { departure = parseInt(departure, 10); $("#nightsOff").val(departure - arrival); stay = 'stay_nights=' + (departure - arrival) + '&'; - alert(stay); if ($("#departOff").val() < $('#departOff').attr("min")) { // $("#dateOff2").val(requiredDate); } @@ -161,7 +159,8 @@ $(document).ready(function () { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids); } else if ($('#propertyNameOff option:selected').text() === "Stafford's Perry Inn") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids); - } else { + } else if ($('#propertyName option:selected').text() === "Property") { + alert("Please Select a Property"); } }); @@ -175,8 +174,8 @@ $(document).ready(function () { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids); } else if ($('#propertyName option:selected').text() === "Stafford's Perry Inn") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids); - } else { - + } else if ($('#propertyName option:selected').text() === "Property") { + alert("Please Select a Property"); } }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index 6820c01..3ac5e27 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -43,7 +43,7 @@ $(document).ready(function () { } y = currentDate.getFullYear(); requiredDate = y + '-' + m + '-' + d; - + start = "arrival_date=" + y + '-' + m + '-' + d + '&'; if (requiredDate < $('#arriveOff').attr("min")) { minDays = $('#arriveOff').attr("min"); $("#arriveOff").val(minDays); @@ -58,7 +58,6 @@ $(document).ready(function () { m = '0' + m; } y = currentDate.getFullYear(); - start = "arrival_date=" + y + '-' + m + '-' + d + '&'; requiredDate = y + '-' + m + '-' + d; arrival = d + '-' + m + '-' + y; arrival.toString(); @@ -90,7 +89,6 @@ $(document).ready(function () { departure = parseInt(departure, 10); $("#nightsOff").val(departure - arrival); stay = 'stay_nights=' + (departure - arrival) + '&'; - alert(stay); if ($("#departOff").val() < $('#departOff').attr("min")) { // $("#dateOff2").val(requiredDate); } @@ -152,7 +150,8 @@ $(document).ready(function () { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids); } else if ($('#propertyNameOff option:selected').text() === "Stafford's Perry Inn") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids); - } else { + } else if ($('#propertyName option:selected').text() === "Property") { + alert("Please Select a Property"); } }); @@ -166,8 +165,8 @@ $(document).ready(function () { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + crookedRiver + start + stay + adults + kids); } else if ($('#propertyName option:selected').text() === "Stafford's Perry Inn") { window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids); - } else { - + } else if ($('#propertyName option:selected').text() === "Property") { + alert("Please Select a Property"); } }); -- 2.17.1