Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6060139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:47:29+00:00 2026-05-23T08:47:29+00:00

In a create form, the user types his name, then his surname, and when

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:47:29+00:00Added an answer on May 23, 2026 at 8:47 am

    Here is a small demo that I made hopefully this is what you are looking for

    name:    <input id="name" /> <br>
    surname: <input id="surname" /><br>
    username: <input onfocus="input()" id="username" />
    

    those are the inputs and here is the function that gets called onfocus in the username field

    function input(){
    var name = document.getElementById('name').value;
    var surname = document.getElementById('surname').value;
    var username = '';
    
    //only fill in the field if name and surname are entered 
    if(name != '' && surname != ''){
        username = name+'.'+surname;
        document.getElementById('username').value = username;
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a simple user registration form with First / Last name,
I would like to create a form where a user can enter an arbitrary
I am attempting to create a form where a user is able to enter
I'd like to create a user registration form where the user ticks some boxes
I have got a form which a user can use to create a new
I'm trying to create a child form that helps the user to enter data
I am trying to create an asp.net web form that allows a user to
I have a simple form right now: <form action='<? echo $PHP_SELF;?>' method='POST'> Username:<input type='text'
I want to create user profile with image. That user can upload his photo,
The Setup I have a (rather standard) form that allows a user to create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.