Hi, using the Toolset User Form and "Automatically create password/username", there's a way to establish the password/username structure before it is submitted?
I would need this to be something like
firstname_lastname
pass+userid
Thanks
Hi,
Thank you for contacting us and I'd be happy to assist.
I'm afraid, there is no built-in feature or function available to set a specific format for the automatically generated usernames and passwords.
One workaround that you can use for setting a username consisting of the first and last name, is to disable the option "Auto-generate Username" so that there is a field in the form to enter it.
Next, in the form's "JS editor", you can include the following custom script, which can automatically fill the username value in its field, in the "firstname_lastname" format, as a user makes changes in the first and last name field values, in their respective fields.
jQuery(document).ready(function( $ ) {
// get the values from the first and last name fields and fill them in the username field
$.fn.setAutoUsername = function(){
$("input[name=user_login]").val($("input[name=first_name]").val()+'_'+$("input[name=last_name] ").val());
}
// detect change in the first name and last name field and execute function 'setAutoUsername'
$("input[name=first_name], input[name=last_name] ").change(function(){
$.fn.setAutoUsername();
});
});
You can hide the username field using custom CSS code so that users can't actually see it and make any changes.
Setting a password in any specific format is more challenging and it makes a little sense, as it can be changed by the user, later.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar