diff --git a/public/js/vroom.js b/public/js/vroom.js index c87c5b0..3cd469b 100644 --- a/public/js/vroom.js +++ b/public/js/vroom.js @@ -681,7 +681,8 @@ function initVroom(room) { }); // Join password protection - $('#setJoinPassButton').click(function(event) { + $('#joinPassForm').submit(function(event) { + event.preventDefault(); var pass = $('#joinPass').val(); $('#joinPass').val(''); $('#setJoinPassButton').addClass('disabled'); @@ -734,7 +735,7 @@ function initVroom(room) { }); }); - + // Set owner password $('#ownerPass').on('input', function() { if ($('#ownerPass').val() == ''){ $('#setOwnerPassButton').addClass('disabled'); @@ -743,9 +744,8 @@ function initVroom(room) { $('#setOwnerPassButton').removeClass('disabled'); } }); - - // Set owner password - $('#setOwnerPassButton').click(function(event) { + $('#ownerPassForm').submit(function(event) { + event.preventDefault(); var pass = $('#ownerPass').val(); $('#ownerPass').val(''); $('#setOwnerPassButton').addClass('disabled'); diff --git a/templates/default/join.html.ep b/templates/default/join.html.ep index ac1b66e..553f4c2 100644 --- a/templates/default/join.html.ep +++ b/templates/default/join.html.ep @@ -87,14 +87,14 @@