How can I auto populate a text field with a substring of another field?

  • Profile Image
    Hfplus
    Asked on June 19, 2015 at 10:23 AM

    We have a text field where the input might be: 004S01234567

    We want to auto populate another text field with everything past the "S" in the first text field. Results being: 01234567.

    We are able to do this in excel as a formula like: =RIGHT(TEXT,8) and this would return the 8 characters starting from the right.

    How can this be done in a form?

     

    Thank you,

    HFplus

  • Profile Image
    Boris
    Answered on June 19, 2015 at 12:19 PM

    You can do that by using our Substring widget (manual: How-to-Add-a-Widget-to-your-Form)

    I have set up a small demo of it, here:

    http://form.jotformpro.com/form/51694748956980

    The settings of the Substring widget would be as follows:

    1 = which fields has the full code
    2 = which character to start with, start after 4th
    3 = which character to end with, we put a number that we know is larger than the secret code will be, in this case 99

    Now, if you want to forward this (sub)string from the widget to another field of the form, you can use Conditional-Logic to update that fields value from this widget.

    Please let us know if you need further assistance.