Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Automatically removing text from a username

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Colin - 27 Jan 2006 19:06 GMT
Hello,

I am creating a form that automatically picks up the person's username and
inputs it into the form.  The username's in our organization ire in the
following format:

firstname.lastname

What I want to be able to do is strip out the period in-between the first
and last name, then put the last name first and the first name last with a
comma in-between them.

Can anyone provide me with a quick chunk of JScript code that can easily
take care of this for me?
S.Y.M. Wong-A-Ton - 27 Jan 2006 19:53 GMT
Haven't tested this, but it should work.

---
var oldName = "firstname.lastname";
var arrNameParts = oldName.split(".");
var newName = "";
if (arrNameParts.length == 2)
{
  newName = arrNameParts[1] + ", " + arrNameParts[0];
}

---
S.Y.M. Wong-A-Ton

> Hello,
>
[quoted text clipped - 10 lines]
> Can anyone provide me with a quick chunk of JScript code that can easily
> take care of this for me?
Colin - 30 Jan 2006 17:03 GMT
it worked great, thank you very much

> Haven't tested this, but it should work.
>
[quoted text clipped - 24 lines]
> > Can anyone provide me with a quick chunk of JScript code that can easily
> > take care of this for me?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.