Revised the username validation pattern in register account
This commit is contained in:
parent
25b1b9bda2
commit
b21aa1ab33
|
@ -10,8 +10,13 @@
|
|||
<label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
|
||||
</div>
|
||||
<div class="${properties.kcInputWrapperClass!}">
|
||||
<input type="text" id="username" name="username" value="${(user.username!'')}" class="${properties.kcInputClass!}" pattern="^(?!postfix$)(?!cyrus$)[^\s/\-\\]+$" />
|
||||
<input type="text" id="username" name="username" value="${(user.username!'')}" class="${properties.kcInputClass!}" pattern="^(?!postfix$)(?!cyrus$)[a-zA-Z0-9\.]+$" />
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
document.getElementById("username").oninvalid = function(ev) {
|
||||
ev.target.setCustomValidity('${msg("usernameValidityMsg")}')
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</#if>
|
||||
<div class="${properties.kcFormGroupClass!} ${messagesPerField.printIfExists('email',properties.kcFormGroupErrorClass!)}">
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
confirmLinkIdpReviewProfile=Review information for new profile
|
||||
|
||||
termsAcceptMsg=You have to scroll down to read and then accept the terms
|
||||
termsAcceptMsg=You have to scroll down to read and then accept the terms
|
||||
|
||||
usernameValidityMsg=Only letters, numbers and dots are permitted
|
|
@ -1 +1,3 @@
|
|||
confirmLinkIdpReviewProfile=Rivedi le informazioni del nuovo profilo
|
||||
confirmLinkIdpReviewProfile=Rivedi le informazioni del nuovo profilo
|
||||
|
||||
usernameValidityMsg=Sono consentiti solo lettere, numeri e punti
|
|
@ -37,8 +37,13 @@
|
|||
<label for="username" class="${properties.kcLabelClass!}">${msg("username")}</label>
|
||||
</div>
|
||||
<div class="${properties.kcInputWrapperClass!}">
|
||||
<input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')}" pattern="^(?!postfix$)(?!cyrus$)[\w\.]+$" autocomplete="username" />
|
||||
<input type="text" id="username" class="${properties.kcInputClass!}" name="username" value="${(register.formData.username!'')}" pattern="^(?!postfix$)(?!cyrus$)[a-zA-Z0-9\.]+$" autocomplete="username" />
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
document.getElementById("username").oninvalid = function(ev) {
|
||||
ev.target.setCustomValidity('${msg("usernameValidityMsg")}')
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</#if>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
function checkKcTermsScrollHeight(){
|
||||
var kcTermsTextElement = document.getElementById("kc-terms-text")
|
||||
if ((kcTermsTextElement.scrollTop + kcTermsTextElement.offsetHeight) >= kcTermsTextElement.scrollHeight){
|
||||
if ((kcTermsTextElement.scrollTop + kcTermsTextElement.offsetHeight + 5) >= kcTermsTextElement.scrollHeight){
|
||||
document.getElementById("kc-accept").disabled = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue