Update for javascript
authorSteve Sutton <steve@gaslightmedia.com>
Fri, 20 Jul 2018 11:59:05 +0000 (07:59 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Fri, 20 Jul 2018 11:59:05 +0000 (07:59 -0400)
Changes to select. Let's use the val and not labels.

js/app.js
js/custom/pageSetup.js

index 269e346..ecf19a1 100644 (file)
--- a/js/app.js
+++ b/js/app.js
@@ -148,13 +148,13 @@ $(document).ready(function () {
     $('.res-buttonOff').on('click', function () {
         adults = "adults=" + $("#adultsOff").val() + "&";
         kids = "children=" + $("#kidsOff").val();
-        if ($('#propertyNameOff option:selected').text() === "Stafford's Bay View Inn") {
+        if ($('#propertyNameOff option:selected').val() === "Stafford's Bay View Inn") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids);
-        } else if ($('#propertyNameOff option:selected').text() === "Stafford's Crooked River Lodge") {
+        } else if ($('#propertyNameOff option:selected').val() === "Stafford's Crooked River Lodge") {
             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 Hotel") {
+        } else if ($('#propertyNameOff option:selected').val() === "Stafford's Perry Hotel") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids);
-        } else if ($('#propertyName option:selected').text() === "Property") {
+        } else if ($('#propertyName option:selected').val() === "Property") {
             alert("Please Select a Property");
         }
     });
@@ -162,13 +162,13 @@ $(document).ready(function () {
     $('.res-button').on('click', function () {
         adults = "adults=" + $("#adults").val() + "&";
         kids = "children=" + $("#kids").val();
-        if ($('#propertyName option:selected').text() === "Stafford's Bay View Inn") {
+        if ($('#propertyName option:selected').val() === "Stafford's Bay View Inn") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids);
-        } else if ($('#propertyName option:selected').text() === "Stafford's Crooked River Lodge") {
+        } else if ($('#propertyName option:selected').val() === "Stafford's Crooked River Lodge") {
             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 Hotel") {
+        } else if ($('#propertyName option:selected').val() === "Stafford's Perry Hotel") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids);
-        } else if ($('#propertyName option:selected').text() === "Property") {
+        } else if ($('#propertyName option:selected').val() === "Property") {
             alert("Please Select a Property");
         }
     });
index ae465c6..d2192d0 100644 (file)
@@ -139,13 +139,13 @@ $(document).ready(function () {
     $('.res-buttonOff').on('click', function () {
         adults = "adults=" + $("#adultsOff").val() + "&";
         kids = "children=" + $("#kidsOff").val();
-        if ($('#propertyNameOff option:selected').text() === "Stafford's Bay View Inn") {
+        if ($('#propertyNameOff option:selected').val() === "Stafford's Bay View Inn") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids);
-        } else if ($('#propertyNameOff option:selected').text() === "Stafford's Crooked River Lodge") {
+        } else if ($('#propertyNameOff option:selected').val() === "Stafford's Crooked River Lodge") {
             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 Hotel") {
+        } else if ($('#propertyNameOff option:selected').val() === "Stafford's Perry Hotel") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids);
-        } else if ($('#propertyName option:selected').text() === "Property") {
+        } else if ($('#propertyName option:selected').val() === "Property") {
             alert("Please Select a Property");
         }
     });
@@ -153,13 +153,13 @@ $(document).ready(function () {
     $('.res-button').on('click', function () {
         adults = "adults=" + $("#adults").val() + "&";
         kids = "children=" + $("#kids").val();
-        if ($('#propertyName option:selected').text() === "Stafford's Bay View Inn") {
+        if ($('#propertyName option:selected').val() === "Stafford's Bay View Inn") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + bayView + start + stay + adults + kids);
-        } else if ($('#propertyName option:selected').text() === "Stafford's Crooked River Lodge") {
+        } else if ($('#propertyName option:selected').val() === "Stafford's Crooked River Lodge") {
             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 Hotel") {
+        } else if ($('#propertyName option:selected').val() === "Stafford's Perry Hotel") {
             window.open("https://www.bookonthenet.net/east/premium/eresmain.aspx?id=" + perry + start + stay + adults + kids);
-        } else if ($('#propertyName option:selected').text() === "Property") {
+        } else if ($('#propertyName option:selected').val() === "Property") {
             alert("Please Select a Property");
         }
     });