diff --git a/web/js/register.js b/web/js/register.js new file mode 100644 index 0000000..7a59132 --- /dev/null +++ b/web/js/register.js @@ -0,0 +1,19 @@ +$("#registration-form").on("submit", function(e) { + e.preventDefault(); + register($("#name").val(), $("#username").val(), $("#password").val(), $("#password_confirm").val(), $("#email").val()); +}); + +function register(name, username, password, password_confirm, email) { + $.post("/api/user/register", { + name: name, + username: username, + password: password, + password_confirm: password_confirm, + email: email + }, function(data) { + $("#status").text(data.message); + if (data.success == 1) { + // wait then redirect or whatever + } + }); +} diff --git a/web/register.html b/web/register.html index 34f2928..60bf1d0 100644 --- a/web/register.html +++ b/web/register.html @@ -2,6 +2,7 @@ Register + @@ -20,42 +21,47 @@

Register Yourself



-
- -
-

- -

-
- -
-

-
- -
-

-
- -
-

-
- -
-

-
-

- +
+
+ +
+

+ +

+
+ +
+

+
+ +
+

+
+ +
+

+
+ +
+

+
+

+ +
+
+
+