From 1a6d833db305aa8ac84f6ae80d3f9b9a4b4f7459 Mon Sep 17 00:00:00 2001 From: hydrant Date: Fri, 8 May 2020 16:21:34 +0200 Subject: [PATCH] login/register seite nicht neuladen + focus auf input --- ReallifeGamemode.Client/assets/html/login/login.html | 2 +- .../assets/html/login/register.html | 2 +- .../assets/js/login/application.js | 11 +++++++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ReallifeGamemode.Client/assets/html/login/login.html b/ReallifeGamemode.Client/assets/html/login/login.html index a566ea86..4a47656e 100644 --- a/ReallifeGamemode.Client/assets/html/login/login.html +++ b/ReallifeGamemode.Client/assets/html/login/login.html @@ -23,7 +23,7 @@
- +
diff --git a/ReallifeGamemode.Client/assets/html/login/register.html b/ReallifeGamemode.Client/assets/html/login/register.html index e9af646d..81239c8d 100644 --- a/ReallifeGamemode.Client/assets/html/login/register.html +++ b/ReallifeGamemode.Client/assets/html/login/register.html @@ -28,7 +28,7 @@
- +
diff --git a/ReallifeGamemode.Client/assets/js/login/application.js b/ReallifeGamemode.Client/assets/js/login/application.js index 3e0e4977..622107f8 100644 --- a/ReallifeGamemode.Client/assets/js/login/application.js +++ b/ReallifeGamemode.Client/assets/js/login/application.js @@ -18,8 +18,15 @@ $(document).ready(function () { } } - $('form.login').submit(function () { mp.trigger("CEF:Login_LoginRequest", passwordField.val()) }); - $('form.register').submit(function () { mp.trigger("CEF:Login_RegisterRequest", passwordField.val()) }); + $('form.login').submit(function (e) { + e.preventDefault(); + mp.trigger("CEF:Login_LoginRequest", passwordField.val()) + }); + + $('form.register').submit(function (e) { + e.preventDefault(); + mp.trigger("CEF:Login_RegisterRequest", passwordField.val()) + }); }); function setPlayerName(name) {