streams/view/js/mod_register.js

57 lines
1.6 KiB
JavaScript
Raw Normal View History

$(document).ready(function() {
2016-02-22 12:04:48 +00:00
$("#id_email").blur(function() {
var zreg_email = $("#id_email").val();
$.get("register/email_check.json?f=&email=" + encodeURIComponent(zreg_email), function(data) {
2016-02-22 12:04:48 +00:00
$("#help_email").html(data.message);
zFormError("#help_email",data.error);
});
});
2016-02-22 12:04:48 +00:00
$("#id_password").blur(function() {
if(($("#id_password").val()).length < 6 ) {
$("#help_password").html(aStr.pwshort);
zFormError("#help_password", true);
}
else {
2016-02-22 12:04:48 +00:00
$("#help_password").html("");
zFormError("#help_password", false);
}
});
2016-02-22 12:04:48 +00:00
$("#id_password2").blur(function() {
if($("#id_password").val() != $("#id_password2").val()) {
$("#help_password2").html(aStr.pwnomatch);
zFormError("#help_password2", true);
}
else {
2016-02-22 12:04:48 +00:00
$("#help_password2").html("");
zFormError("#help_password2", false);
}
});
2016-02-22 12:04:48 +00:00
$("#id_name").blur(function() {
$("#name-spinner").show();
2016-02-22 12:04:48 +00:00
var zreg_name = $("#id_name").val();
$.get("new_channel/autofill.json?f=&name=" + encodeURIComponent(zreg_name),function(data) {
2016-02-22 12:04:48 +00:00
$("#id_nickname").val(data);
if(data.error) {
$("#help_name").html("");
zFormError("#help_name",data.error);
}
$("#name-spinner").hide();
});
});
2016-02-22 12:04:48 +00:00
$("#id_nickname").blur(function() {
$("#nick-spinner").show();
2016-02-22 12:04:48 +00:00
var zreg_nick = $("#id_nickname").val();
$.get("new_channel/checkaddr.json?f=&nick=" + encodeURIComponent(zreg_nick),function(data) {
2016-02-22 12:04:48 +00:00
$("#id_nickname").val(data);
if(data.error) {
$("#help_nickname").html("");
zFormError("#help_nickname",data.error);
}
$("#nick-spinner").hide();
});
});
2016-02-22 12:04:48 +00:00
});