What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    Substring widget not working for me

    Asked by MaidCrew on February 22, 2017 at 09:19 AM

    Hi... I found the following thread.


    I need to do the same thing as shown in the thread but after setting everything up, my form / substrings don't seem to want to cooperate. Not sure if I'm doing something wrong?

    Help is appreciated. Thanks.

    (My form link is included... substrings are at the bottom... I tried using update/calculate field of date into a both a textbox and a calculation box (as a text) but neither approach is working.)

    UPDATE1: I've now noticed that it's in the Preview Mode (Version4) that I'm not getting anything showing in the substring fields, but if I view the form on my webpage, I get partial fill-ins and the substrings aren't accurate for one or two of them.

    UPDATE2: Partial (but inaccurate) rendering of substring values shows up on my webpage is if I'm using script embed... if using iframe embed, nothing shows up in fields.

    Page URL:

  • Profile Image
    JotForm Support

    Answered by Welvin on February 22, 2017 at 01:21 PM

    I've fixed it for you. Please note that an action has to be triggered for the widget to work, meaning, you have to select a date to get the strings. 


    Would you also mind re-embedding the form using our iframe method? Please share the page URL after so we can check. I think it's not working due to security, I need to confirm the problem before sending a report to our developers.

  • Profile Image

    Answered by MaidCrew on February 22, 2017 at 02:21 PM

    Okay... thanks... here's what I've got.


    Here's what I've found... I've got a gift card code which will include purchase date as part of the code. The date field I'm pulling from needs to be hidden. There are form calculation widgets with calculations using the date field. (i.e. datestring(date + 3 days) for activation & datestring(date + 365) for expiration) The date field is set as default to "current" date when the form is accessed. So I need the date field to NOT have to be manually triggered.

    When I have the form embedded on website as script, date is auto-triggered and calculation and substring widgets do their thing. If I embed using iframe, date has to be manually triggered for calculation & substring widgets to function as designed.... so i need to embed using script... unless you can fix the iframe functionality so that the date, when set at default of "current", does it's thing and don't have to be manually set by the form user.

    With that said, after reading your response at having fix the issue, It worked.... BUT, I then changed my "year" substring from characters 7 - 10 to only 10 - 10 (cause I only want the last digit of the year (2017 = 7 ... 2018 = 8) .... when I made the change to the substring, the substring stopped working again.

  • Profile Image

    Answered by MaidCrew on February 22, 2017 at 02:50 PM

    I forgot to ask... should I be piping date by way of a copy field condition into a text box or a calculation box?

  • Profile Image
    JotForm Support

    Answered by Welvin on February 22, 2017 at 03:58 PM

    If the embed script works, please keep that. We only suggest iframe method if some part of the form won't work on the website. 

    Try 8 and 9 or 9 and 10. And, the calculation box will do. Passing the date into the calculation is important since the substring will only work with textboxes.