In a create form, the user types his name, then his surname, and when he focuses on the username text field, the surname.name String must be appended automatically.
In other words, Using javascript, once the USERNAME input text field receives focus, the values of NAME & SURNAME input text fields must be appended to it automatically and separated by a dot (.) = surname.name
<h:outputLabel value="#{bundle.CreateUsersLabel_name}" for="name" />
<h:inputText id="name" value="#{usersController.selected.name}" title="#{bundle.CreateUsersTitle_name}" />
<h:outputLabel value="#{bundle.CreateUsersLabel_surname}" for="surname" />
<h:inputText id="surname" value="#{usersController.selected.surname}" title="#{bundle.CreateUsersTitle_surname}" />
<h:outputLabel value="#{bundle.CreateUsersLabel_username}" for="username" />
<h:inputText id="username" value="#{usersController.selected.username}" title="#{bundle.CreateUsersTitle_username}" required="true" requiredMessage="#{bundle.CreateUsersRequiredMessage_username}"/>
Any ideas please?
Here is a small demo that I made hopefully this is what you are looking for
those are the inputs and here is the function that gets called onfocus in the username field