diff --git a/skolehjem/resources/views/app/washing-reservations/create.blade.php b/skolehjem/resources/views/app/washing-reservations/create.blade.php index 833e984..f26adcb 100644 --- a/skolehjem/resources/views/app/washing-reservations/create.blade.php +++ b/skolehjem/resources/views/app/washing-reservations/create.blade.php @@ -343,7 +343,7 @@ //Update selects function updateForm() { - console.log("Updating form..."); + //console.log("Updating form..."); var location_id; var machine_id; @@ -354,7 +354,14 @@ else location_id = 0; - console.log("location_id: " + location_id); + //console.log("location_id: " + location_id); + + //If a washing-machine select exists, set machine_id to its currently selected options value + //Else set it to 0 + if(document.getElementById('washing-machines') !== null) + machine_id = document.getElementById('washing-machines').value; + else + machine_id = 0; axios({ method: 'get', @@ -374,7 +381,7 @@ else machine_id = 0; - console.log("machine_id: " + machine_id); + //console.log("machine_id: " + machine_id); axios({ method: 'get',