Open GoogleCodeExporter opened 9 years ago
Hi,
I solve this problem by changing the newuser.js and the form.jsp files as
follow :
newuser.js: Add the functions
function autoGen(prenom, nom){
var prenom = document.getElementById("givenName").value;
var nom = document.getElementById("sn").value;
uidGen(prenom, nom);
cnGen(prenom, nom);
}
function uidGen(prenom, nom){
prenom = prenom.replace('-', ' ').replace('\'', ' ');
var prenoms = prenom.split(' ');
var uidPrenom = "";
for (var i=0;i<prenoms.length;i=i+1){
uidPrenom = uidPrenom + prenoms[i].substring(0, 1);
}
var noms = nom.split(' ');
var uidNom = "";
for (var i=0;i<noms.length;i=i+1){
uidNom = uidNom + noms[i];
}
var uid = uidPrenom.toLowerCase() + uidNom.toLowerCase();
document.getElementById("uid").value = uid;
}
function cnGen(prenom, nom){
var cn = prenom + ' ' + nom;
document.getElementById("cn").value = cn;
}
forms.jsp : change the input tag pour appeler la function autoGen :
<input style="text-align: left;" id="<%=loopConfiguration.getName()%>"
type="<%=loopConfiguration.getType()%>" class="inputfield"
name="<%=loopConfiguration.getName()%>" value="<%= currentValue %>"
<%if(loopConfiguration.getPlaceholder()!=null){%> placeholder="<%=loopConfiguration.getPlaceholder()%>"<%}%>
<%if(loopConfiguration.isRequired()){%> required="required"<%}%>
<%if(loopConfiguration.isConfirmationRequired()) { %> onkeypress="getObject('<%=loopConfiguration.getName()%>_confirm').value=''"<% } %>
maxlength="<%=loopConfiguration.getMaximumLength()%>"
<%if((loopConfiguration.getName().equals("sn"))||(loopConfiguration.getName().equals("givenName"))){%> onblur='autoGen(this.form.givenName.value, this.form.sn.value)'<%}%>/>
Original comment by mdii.al...@gmail.com
on 8 Jul 2014 at 2:23
Original issue reported on code.google.com by
lin...@gmail.com
on 28 May 2014 at 5:36