From cb2d8b4ba62f2510a1305bbe95452f4de008286a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 8 Apr 2021 15:03:05 +0000 Subject: register: minor js cleanup --- view/js/mod_register.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/view/js/mod_register.js b/view/js/mod_register.js index 3f8f50898..19be1576f 100644 --- a/view/js/mod_register.js +++ b/view/js/mod_register.js @@ -14,19 +14,17 @@ $(document).ready(function() { $('#id_email').change(function() { tao.zar.form.email = $('#id_email').val(); - if (tao.zar.patano.test(tao.zar.form.email) == true ) { - //ano + + if (tao.zar.patema.test(tao.zar.form.email) == false ) { + $('#help_email').removeClass('text-muted').addClass('text-danger').html(aStr['email_not_valid']); + zFormError('#help_email',true); } else { - if (tao.zar.patema.test(tao.zar.form.email) == false ) { - $('#help_email').removeClass('text-muted').addClass('text-danger').html(aStr['email_not_valid']); - zFormError('#help_email',true); - } else { - $.get('register/email_check.json?f=&email=' + encodeURIComponent(tao.zar.form.email), function(data) { + $.get('register/email_check.json?f=&email=' + encodeURIComponent(tao.zar.form.email), function(data) { $('#help_email').removeClass('text-muted').addClass('text-danger').html(data.message); zFormError('#help_email',data.error); - }); - } + }); } + if ($('#id_email').val().length > 0) { $('#newchannel-submit-button').removeAttr('disabled'); } -- cgit v1.2.3