Commit 2eb8d326 authored by jbuechele's avatar jbuechele
Browse files

added nickname to register form

parent f6ded991
......@@ -50,8 +50,13 @@
</div>
<div class="form-group">
<label for="mobileNumber">Mobile number</label>
<input id="mobileNumber" type="text" class="form-control" name="mobileNumber">
<label for="nickname" class="required">Nickname</label>
<input id="nickname" type="text" class="form-control" name="user.attributes.nickname" required>
</div>
<div class="form-group">
<label for="mobile">Mobile number</label>
<input id="mobile" type="text" class="form-control" name="user.attributes.mobile">
</div>
<div class="form-group">
......
......@@ -46,6 +46,13 @@ function addError(event) {
$('#' + event.target.id).addClass("is-invalid");
}
function setNickname() {
if(!$('#nickname').val()) {
const nickname = $('#firstName').val() + '.' + $('#lastName').val();
$('#nickname').val(nickname.toLowerCase());
}
}
$(document).ready(() => {
$("#password-confirm").change((event) => {
const password = $("#password").val();
......@@ -77,6 +84,7 @@ $(document).ready(() => {
$("#registerBtn").prop('disabled', true);
} else {
$("#registerBtn").prop('disabled', false);
setNickname();
}
});
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment