Added warning if property not selected
authorAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Nov 2015 14:51:53 +0000 (09:51 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Tue, 10 Nov 2015 14:51:53 +0000 (09:51 -0500)
js/app.js
js/custom/pageSetup.js

index 0992dea..0a85894 100644 (file)
--- 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");
         }
 
     });
index 6820c01..3ac5e27 100644 (file)
@@ -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");
         }
 
     });