Developer forum

Forum » Templates » Username customization

Username customization

Natalia Grynenko
Reply
Hello,


    I need separated First Name and Last Name in the User profile. So I created two additional custom fields: First Name and Last Name and want to save value of these fields in the Username field. How can I do it?


Thanks.

Replies

 
Vladimir
Reply
This post has been marked as an answer
Hi Natalia!
Try to add in template a hidden input for the UserName:
<input name="<!--@UserManagement:User.UserName.InputName-->" type="hidden" id="<!--@UserManagement:User.Zip.InputName-->" />
and onblur event for First Name and Last Name fields, something like:
<input name="<!--@CustomField.SystemFirstName-->" type="text" id="<!--@CustomField.SystemFirstName-->"  onblur="<!--@UserManagement:User.UserName.InputName-->.value=this.value + ' ' + <!--@CustomField.SystemLastName-->.value" />
<input name="<!--@CustomField.SystemLastName-->" type="text" id="<!--@CustomField.SystemLastName-->"  onblur="<!--@UserManagement:User.UserName.InputName-->.value=<!--@CustomField.SystemFirstName-->.value + ' ' + this.value" />

Best regards,
Vladimir
Votes for this answer: 0
 
Natalia Grynenko
Reply
Thanks a lot.

 

You must be logged in to post in the forum