mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 15:35:45 +02:00
installer: validate email
This commit is contained in:
@@ -55,6 +55,15 @@ $('document').ready(function() {
|
||||
}
|
||||
}
|
||||
|
||||
function validateEmail(field) {
|
||||
if (!utils.isEmailValid(field)) {
|
||||
parent.addClass('error');
|
||||
help.html('Invalid Email Address.');
|
||||
} else {
|
||||
parent.removeClass('error');
|
||||
}
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case 'username':
|
||||
return validateUsername(field);
|
||||
@@ -62,6 +71,8 @@ $('document').ready(function() {
|
||||
return validatePassword(field);
|
||||
case 'confirm':
|
||||
return validateConfirmPassword(field);
|
||||
case 'email':
|
||||
return validateEmail(field);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -55,6 +55,13 @@
|
||||
</div>
|
||||
<div class="col-sm-5 help-text" data-help="Enter an <strong>alphanumeric username</strong>. Spaces between words are allowed. You can always change your username later on your profile page."></div>
|
||||
</div>
|
||||
<div class="row input-row">
|
||||
<div class="col-sm-7 col-xs-12 input-field">
|
||||
<label for="email">Email Address</label>
|
||||
<input type="text" class="form-control" name="email" placeholder="Email Address" />
|
||||
</div>
|
||||
<div class="col-sm-5 help-text" data-help="Please enter your email address."></div>
|
||||
</div>
|
||||
<div class="row input-row">
|
||||
<div class="col-sm-7 col-xs-12 input-field">
|
||||
<label for="password">Password</label>
|
||||
@@ -67,7 +74,7 @@
|
||||
<label for="confirm">Confirm Password</label>
|
||||
<input type="password" class="form-control" name="confirm" placeholder="Confirm Password" />
|
||||
</div>
|
||||
<div class="col-sm-5 help-text" data-help="Re-enter your password again."></div>
|
||||
<div class="col-sm-5 help-text" data-help="Please confirm your password."></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user