0

Upon registration using Solspace User, I would like to force the submitted username to be equal to first_name|last_name, similar to how the Screen Name is created. Is this possible?

0
0

Unfortunately this isn't possible. I recommend submitting this as a Feature Request under the specific add-on category. It'll also give other users the option to vote up the feature request, and help us prioritize features to add in upcoming versions of this add-on. http://support.solspace.com/support/discussions

0

I do this with a bit of javascript.

<script>
$().ready(function() {
$("#username").focus(function() {
var firstname = $("#first_name").val();
var lastname = $("#last_name").val();
var letter = firstname.charAt(0).toLowerCase();
var lname = lastname.toLowerCase().replace(/\s/g, "");
if(letter && lastname && !this.value) {
this.value = letter + lname;
}
});
</script>
1
  • Could you expand this answer to include back-end validation? This method allows any user with a developer console to override this method. – jrothafer Sep 29 '15 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.