Use logic to split a Full name into First Name Second Name

  • Profile Image
    Mrkay
    Asked on May 29, 2015 at 07:37 AM

    Hi,

     

    I've had a look through the forum and I am unable to find a definitive answer on this.

     

    I need to split a text box into two separate fields.

     

    For example:

    FULL NAME:

    John Smith

     

    to...

     

    FIRST NAME:

     

    John

     

    SECOND NAME:

     

    Smith

     

    The logic should be to split the first name after a SPACE

     

    John[ ]Smith

     

    Please let me know if this is possible.

     

    Thanks,

     

    Jamie

     

     

  • Profile Image
    Sammy
    Answered on May 29, 2015 at 10:42 AM

    Hallos Jamie,

    At the present we don't have the option to split a string based on space of characters, the closest available option is the sub-string but this splits a string based on the position number e.g split a string after the 4th character

     

    If you need to implement the above functionality you can download you full form source code then use JavaScript and regex to achieve the desired effect.

    For now you can use two textboxes to collect the respective portions of the names if you want them to occupy separate fields in the submissions data.

    The full names input only separates the names in the form view and combines them in the submissions data, you can also use this if you goal of splitting is for display purposes only