locked
Auto populate a textbox based on the value entered from the other textbox RRS feed

  • Question

  • Hi,

    My scenario is. let's say I have 2 textbox - txtFName and txtLName. I will be entering the first name of an existing user in the sharepoint site in the txtFName field (ex: the user's complete name is : Chuck Norris)

    If I enter "Chuck" into the txtFName, then txtLName will be automatically populated with "Norris".

    Does any body know how to do this?


    ----------------------- Sharepoint Newbie
    Monday, May 30, 2011 5:50 AM

All replies

  • Sure, it's easy as long as you have a data source that defines this information and as long as no two first names are the same.  You didn't mention where these names are defined, though, and it's never a good idea to use First name as a foreign key nor is it ever good to have users type in names.  It's much better to use a unique value like username, ID, or account name, because those guarantee you get the proper last name.  Also, this data is typically kept in the profile database, and you can use the User Profile Service to retrieve profile data for any user as long as you have their user id.  You can also use a Contact Selector to actually choose a real name instead of typing in a name - just like in Outlook.

    Is there a reason you're not using any of these methods and instead want users to type in first names?


    SharePoint Architect || Microsoft MVP || My Blog
    Planet Technologies || SharePoint Task Force
    Tuesday, May 31, 2011 7:00 AM
  • Hi Clayton

    Thanks for the link, but the 1st link was not working for me. It doesnt display the first name.

    I will just be pulling out the data from the sharepoint site. the


    ----------------------- Sharepoint Newbie
    Tuesday, May 31, 2011 8:31 AM