From 6421810622b47af00454d16a02c1767c80fb7b4d Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Fri, 20 Jul 2018 07:59:05 -0400 Subject: [PATCH] Update for javascript Changes to select. Let's use the val and not labels. --- js/app.js | 16 ++++++++-------- js/custom/pageSetup.js | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/js/app.js b/js/app.js index 269e346..ecf19a1 100644 --- 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"); } }); diff --git a/js/custom/pageSetup.js b/js/custom/pageSetup.js index ae465c6..d2192d0 100644 --- a/js/custom/pageSetup.js +++ b/js/custom/pageSetup.js @@ -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"); } }); -- 2.17.1