Enable/ Require Field Condition: set the max character/word limit of a field based on a user's answer in order to allow special characters.

  • Profile Image
    txforesttrail
    Asked on July 11, 2018 at 11:37 AM

    Hi there,

    Would it be possible to dynamically or conditionally set the max character/word limit parameters of a text field based on a user's answer or selection in a previous field.

    Thought 1:
    The character/word limits could be based on a field calculation. This thought seems to be similar to this one, which is not exactly the same, but wants to limit the min/max entry of a number field.

    https://www.jotform.com/answers/1309459-Dynamically-set-the-min-max-entry-limit-of-number-field-with-the-value-of-another-form-field-Output-calculations-to-parameters-not-only-fields-


    Thought 2:
    Another way this might work is through predefined conditions. Jotform's "Enable/Require Field" option already allows us to conditionally set or change the parameters of a field's Input Mask.


    Could the adjustment of the min/max word/character parameters be added to the "Enable/ Require Field" options?

    1531316862Screenshot 2018-07-11 08.30.39

    1531322672Screenshot 2018-07-11 10.23.33

    Thought 3:
    The closest, I have come to my desired result, of dynamically changing the max word limit of a text field is by using a conditional input mask.

    The problem is *, #,  and @ do not allow for special characters. In other programs "n" or "c" are sometimes used to allow for optional special characters like spaces and punctuation.

    If neither of the above options would work, could there be a new input mask symbol that would allow for spaces or optional special characters?

    1531316988Screenshot 2018-07-11 08.26.45


    Thought 4:
    If none of the above options are possible, is there a way to do this with custom CSS? Or do you have any other options?


    Thank you so much for your assistance.


  • Profile Image
    BDAVID
    Answered on July 11, 2018 at 12:37 PM

    Any of the methods you have proposed would required a feature request, which we will need to sent to our back-end team. Please note that feature requests do not have an estimated time-frame for implementation, so it could take longer than expected.

    My suggestion would be to create multiple Short Text Entry fields with a different character validation, limit, and mask configuration.

    1531326881limit,mask,input.png

    So, you could show them based on your users answers: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    Let us know if you need more help.

  • Profile Image
    txforesttrail
    Answered on July 11, 2018 at 05:00 PM

    Thank you for taking the time to reply.
    I’ve acutally been using the suggested method with success on simple forms. So, I know it does work.  :)

    But, when I work with more complex forms, it tends to complicate spreadsheet output (more fields=more columns for the "same" answer) and generates copious conditional logic. (see examples 2 & 3 below).


    *I’m wondering, if there might be another way to create dynamically/conditionally changing parameters on my end? Editing the Javascript perhaps?


    That said, perhaps I should better explain my challenges. Here is a simplified version of my scenario.


    ·       Users are asked to select an advertising package A, B, C, D or E


    o   Package A: 40 words


    o   Package B: 80-100 words


    o   Package C: 120-160 words


    o   Package D: 90-120 words


    o   Package E: 240-280 words


    ·       Users who selected B, C, D or E will then be asked to choose from various layout or "section" options unique to their Package.


    o   Package B: 80-100 words


    B1.  One Section: 100 words


    B2. Two Sections: 40 words each


    o   Package C: 120-160 words


    C1.  One Section: 160 words


    C2.  Three Sections:  40 words each


    o   Package D: 90-120 words


    D1.  One Section: 120 words


    D2.  Two Sections: 60 words each


    D3.  Three Sections: 40 words each


    D4.  Four Sections: 30 words each


    o   Package E: 240-280 words


    E1.  One Section: 280 words


    E2. Two Sections: 140 words each


    E3.  Three Sections: 80 words each


    E4.  Four Sections: 60 words each


    ·       Users will now be asked to input content for the selected number of sections. Note: the max number of words for each section (text box/area) is unique to the user's selected Package and Section options.


    So, here are a few example.


    Ex 1. If, dynamic character/word limits were possible.
    It would take 4 text boxes with conditional logic to collect the content from all Package/Section Options.  Spreadsheet output = 4 columns for one question.


    Question 1: Choose a Package: A, B, C, D, E
    Question 2: Select number of sections (options shown based on answer to Question 1)


    Question 3: Please provide section content


    ·       One Section (dynamic character/word length)


    ·       Two Section (dynamic lengths) (hidden if one section)


    ·       Three Sections (dynamic lengths) (hidden if one or two sections)


    ·       Four Sections (dynamic lengths (hidden if one, two, or three sections)




    Ex 2. Keeping the Number of Sections Together
    Using this method it would take 12 text boxes with lots of conditional logic to collect the content from all Package/Section Options.  Spreadsheet output = 12 columns for one question.


    Question 1: Choose a Package: A, B, C, D, E
    Question 2: Select number of sections (options shown based on answer to Question 1)


    Question 3: Section Content
    (Lots of conditional logic would be used to hide/skip text boxes based on  selection)


    Text Box Set 1: (5 individual text boxes)


    ·       Package A one section (different length)


    ·       Package B first section (different length)


    ·       Package C first section (different length)


    ·       Package D first section (different length)


    ·       Package E first section (different length)


    Text Box Set 2:  (4 individual text boxes)


    ·       Package B second section (different length)


    ·       Package C second section (different length)


    ·       Package D second section (different length)


    ·       Package E second section (different length)


    Text Box Set 3: (2 individual text boxes)


    ·       Package D second section (different length)


    ·       Package E second section (different length)


    Text Box Set 4: (2 individual text boxes)


    ·       Package D second section (different length)


    ·       Package E second section (different length)




    Ex 3.  Keep Packages Together:
    Using this method it would take 28 text boxes with lots of conditional logic to collect the content from all Package/Section Options.  Spreadsheet output = 28 columns for one question.


    Question 1: Choose a Package: A, B, C, D, E
    Question 2: Select number of sections (options shown based on answer to Question 1)


    Question 3: Section Content
    (Lots of conditional logic would be used to hide/skip text boxes based on selection)


    Package A: 40 words (1 text box)


    ·        One Section: 40 words


    Package B: 80-100 words (3 individual text boxes)


    ·       One Section: 100 words


    ·       First two Sections: 40 words


    ·       Second two Sections: 40 words


    Package C: 120-160 words (4 individual text boxes)


    ·       One Section: 160 words


    ·       First three Sections 40 words


    ·       Second three Sections: 40 words


    ·       Third three Sections: 40 words


    Package D: 90-120 words (10 individual text boxes)


    ·       One Section: 120 words


    ·       First Two Sections: 60 words


    ·       Second Two Sections: 60 words


    ·       First Three Sections: 40 words


    ·       Second Three Sections: 40 words


    ·       Third Three Sections: 40 words


    ·       First Four Sections: 30 words


    ·       Second Four Sections: 30 words


    ·       Third Four Sections: 30 words


    ·       Fourth Four Sections: 30 words


    Package E: 240-280 words (10 individual text boxes)


    ·       One Section: 280 words


    ·       First Two Sections: 140 words


    ·       Second Two Sections: 140 words


    ·       First Three Sections: 80 words


    ·       Second Three Sections: 80 words


    ·       Third Three Sections: 40 words


    ·       First Four Sections: 60 words


    ·       Second Four Sections: 60 words


    ·       Third Four Sections: 60 words


    ·       Fourth Four Sections: 60 words




    Now, here is the kicker. I simplified the examples above considerably. Each of the possible section options above actually have an additional 6 text boxes and 1 an upload field for every section.


    So, the simplest format which is not currently possible would look more like this:


    Question 1: Choose a Package: A, B, C, D, E
    Question 2: Select number of sections (options shown based on answer to Question 1)


    Question 3: Please provide section content  (34 text boxes, 4 uploads)


    ·       One Section (visible for all sections selected)


    1.     Short Text Box


    2.     Short Text Box


    3.     Short Text Box


    4.     Short Text Box


    5.     Short Text Box


    6.     Short Text Box


    7.     Section 1: Text Area Section (dynamic character/word length)*


    8.     Additional Text Area


    9.     Upload


    ·       Second Section (visible if 2, 3, or 4 sections were chosen)


    1.     Short Text Box


    2.     Short Text Box


    3.     Short Text Box


    4.     Short Text Box


    5.     Short Text Box


    6.     Short Text Box


    7.     Section 2: Text Area Section (dynamic character/word length)*


    8.     Additional Text Area


    9.     Upload


    ·       Third Section (visible if  3, or 4 sections were chosen)


    1.     Short Text Box


    2.     Short Text Box


    3.     Short Text Box


    4.     Short Text Box


    5.     Short Text Box


    6.     Short Text Box


    7.     Section 1: Text Area Section (dynamic character/word length)*


    8.     Additional Text Area


    9.     Upload


    ·       Fourth Section (visible if 4 sections were chosen)


    1.     Short Text Box


    2.     Short Text Box


    3.     Short Text Box


    4.     Short Text Box


    5.     Short Text Box


    6.     Short Text Box


    7.     Section 1: Text Area Section (dynamic character/word length)*


    8.     Additional Text Area


    9.     Upload



    My dream scenario with dynamic parameters makes everything so streamlined. But, when I add the 7 text boxes and the 1 upload button to the appropriate sections in examples 2 & 3 above, the duplicate field questions and conditional logic, gets super crazy…


    In summary:


    ·       Dynamic or conditional character/word limits would be awesome. Could I do this in javascript or css or something else?


    ·       The suggestion of using multiple text fields “works” kind-of, but it actually forces the content you are collecting into multiple fields. Multiple fields for the same question = multiple spreadsheet columns for the same question.


    ·       The spreadsheet output of multiple text fields for the same question is really awkward and creates additional work after form completion (not to mention, that the conditional logic gets really cumbersome).




    Sorry this was so long… and thank you for your assistance…

  • Profile Image
    BDAVID
    Answered on July 11, 2018 at 05:24 PM

    This is very complex, the only option would be downloading your form source code, and hire a JavaScript programmer to create you the code that would validate what you want to: https://www.jotform.com/help/104-How-to-get-the-Full-Source-Code-of-your-Form 

  • Profile Image
    txforesttrail
    Answered on July 11, 2018 at 06:05 PM

    Ok, so .....................

    Your answer is that my need is too complicated for Jotform and that I should hire someone to write javascript?

     

    Interesting - can we at least put in a request for any of the other options I came up with?

     

  • Profile Image
    BDAVID
    Answered on July 11, 2018 at 06:14 PM

    Unfortunately, our builder does not currently have the capability to accomplish what you need.

    I have submitted a feature request to our back-end team to have the adjustment of the min/max word/character parameters be added to the "Enable/ Require Field" options. If this gets implemented in the future, you will be updated via this thread.

  • Profile Image
    txforesttrail
    Answered on July 11, 2018 at 06:19 PM

    Thank you.