Expand my Community achievements bar.

Nomination window for the Adobe Community Advisor Program, Class of 2025, is now open!
SOLVED

Obtaining a split value of a person's full name

Avatar

Level 6

I have a field which a person enters their full name (First Name [space] Last Name). I want to have another field obtain and return the substring/split value of the First name only (i.e. up until it encounters a space in the main string).

For example: A value of John Doe will return "John"

Thank you in advance!

1 Accepted Solution

Avatar

Correct answer by
Level 6

Upon further investigation, I found a solution:

var nameArray = this.rawValue.split(" ");

TextField2.rawValue = "Hello " + nameArray[0];

Credit to dperani70 & aks@lc in a different thread. I hope this helps someone else in the future!

View solution in original post

1 Reply

Avatar

Correct answer by
Level 6

Upon further investigation, I found a solution:

var nameArray = this.rawValue.split(" ");

TextField2.rawValue = "Hello " + nameArray[0];

Credit to dperani70 & aks@lc in a different thread. I hope this helps someone else in the future!