PerfectForms Forums » Formula and Condition Editor

Text caculation - break out 1st and last name

(2 posts)
  1. wliang
    Member

    I need to store 1st and last name seperately, yet the user input field is the combine of the two. How do I seperate them? Thx.

    Posted 2 years ago #
  2. rgatson
    Member

    If you have a 'name' field on your form where the first and last name are separated by a space, or any separator,and you want to have the first and last name stripped out, here is how to do it.
    First make sure you have the objects to collect the first and last name, as well as a hidden object to store the index.
    Choose a behavior to script on, then first drag a 'set field' object to set the index. Use the 'Index of' function to search for the separator in the name field.
    Next, drag another 'set field' for the First name and use the 'sub-text 1' function. In the function, set the start index to 0 and the end index to the field you created for the 'index'.
    Next, drag another 'set field' for the Last name. You will use the 'sub-text 1' function. In the function set the start index to the field you created for the 'index' and the end index to 99.
    Last, drag another 'set field' to remove the leading space from the last name. You will use the 'Left Trim' function to do this. Make sure you write this value back into the 'Last name' object.

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in or register to post.

Contact

1917 Palomar Oaks Way
Suite 160
Carlsbad, CA 92008
866.900.8588

  picture  picture  picture  picture