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.

32 lines
841 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. $("#signup-go").prop("disabled", true);
  6. $.ajax({
  7. url: base + "/accounts/signup/",
  8. type: "post",
  9. data: {"identity": email},
  10. success: function(data) {
  11. $("#signup-result").html(data).show();
  12. $("#signup-go").prop("disabled", false);
  13. }
  14. });
  15. return false;
  16. }
  17. $("#signup-go").on("click", submitForm);
  18. $("#signup-email").keypress(function (e) {
  19. if (e.which == 13) {
  20. return submitForm();
  21. }
  22. });
  23. $("#signup-modal").on('shown.bs.modal', function () {
  24. $("#signup-email").focus()
  25. })
  26. });