From: Anthony Talarico Date: Tue, 10 Nov 2015 14:51:53 +0000 (-0500) Subject: Added warning if property not selected X-Git-Tag: v1.0.0^2~320 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=8cedfd3f435bd81b9bab1813c431b20e503668e9;p=WP-Themes%2Fstaffords.git Added warning if property not selected --- 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"); } });