From 5a295de426175c7cb97b3873f3bd33d2bb5ec673 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A1lint=20Bokros?= Date: Mon, 27 Nov 2017 19:00:38 +0100 Subject: [PATCH] Create handler for form submit --- src/app/static/ws_listener.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/app/static/ws_listener.js b/src/app/static/ws_listener.js index 3909d81..de71ca8 100644 --- a/src/app/static/ws_listener.js +++ b/src/app/static/ws_listener.js @@ -11,7 +11,17 @@ $('#container').on('click', '.anchor', ( function (event) { console.log(data); ws.send(data); })); + +$('form#anchor_login_event').on('submit', (function (event) { + event.preventDefault(); + let anchorName = $(this).attr('id').replace('_event', ''); + $.post( + $(this).attr('action'), + $(this).serialize(), + function (data) {} + ); +})); })); ws.onmessage = function (messageEvent) {