You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
950 B

  1. $(function () {
  2. function submitForm() {
  3. var base = document.getElementById("base-url").getAttribute("href").slice(0, -1);
  4. var email = $("#signup-email").val();
  5. var token = $('input[name=csrfmiddlewaretoken]').val();
  6. $("#signup-go").prop("disabled", true);
  7. $.ajax({
  8. url: base + "/accounts/signup/",
  9. type: "post",
  10. headers: {"X-CSRFToken": token},
  11. data: {"identity": email},
  12. success: function(data) {
  13. $("#signup-result").html(data).show();
  14. $("#signup-go").prop("disabled", false);
  15. }
  16. });
  17. return false;
  18. }
  19. $("#signup-go").on("click", submitForm);
  20. $("#signup-email").keypress(function (e) {
  21. if (e.which == 13) {
  22. return submitForm();
  23. }
  24. });
  25. $("#signup-modal").on('shown.bs.modal', function () {
  26. $("#signup-email").focus()
  27. })
  28. });