On the form I am currently working on, I have a radio button question at the beginning. There are five possible answers.

I would like to have a certain section visible if when two of the five choices are made.

EX: what is today?

Mon | Tue | Wed | Thu | Fri

If "Mon" OR "Tue" is chosen, I'd like a hidden section to be visible.

Possible?

TIA,

Greg

  • No labels

9 Comments

  1. Hi Greg,

    By default, a Section's visibility can only be controlled through a single value. 

    Having said that, it might still be possible to achieve your requirement using some custom JavaScript within a Custom HTML element. The JavaScript could get a bit complicated and would require a bit more advanced JavaScript knowledge though.

    Best Regards,
    Julian

    1. Okay, thank you, Julian. That is beyond my scope.

      So my solution is to create two Sections with the same content; one for each choice.

      Can I use the same ID in two different sections? Or do they have to be unique?

      Sincerely,
      Greg

      1. In this case, Section IDs should be unique :)

        1. Sorry, I meant unique IDs for form elements within the Section. (How inter-related are the sections? If a section is not visible, could it still create a conflict in a process if it has the same ID with an initial value? Or when in a "not visible" state, is it like it doesn't exist in the form?)

          My concern comes from the fact that my part of my process is relying on the value of a variable. Now this variable will be in two sections; only one of which will be visible at any given time. Will this create a conflict?

          1. Oh sorry for having misunderstood your initial question :) 

            Rightly, it is ok to have the same ID for elements in two different sections.

            Unfortunately there's an issue in the current release where conflicts will happen when the form is submitted.

            It has been fixed in the source repository and will be available in the upcoming releases. In the meantime though, I would suggest either using different IDs, or you could give similar IDs a try as it might work under certain circumstances depending on your actual form design.

  2. Anyone have an example to hide or show a section through multiple values ??of variables? I've been looking for reference material but it was impossible to get it and really my javascript knowledge is very limited. My case is that I hide a section if you select a value in a list and display it in any other case. Can you please help me with this issue?

    1. Hi Camilo,

      Maybe you can try this page Show and Hide Form Sections to see if it meets your need?

      Regards,
      Julian

    2. Hello Camilo - see if this works:

      • Show the section if one of the values exists from a previous choice
      • Use the following for multiple values to be good to show the hidden section; meaning the section becomes visible if one of these values exists

      You can separate your value with '|' and check the checkbox to using regular expression. Eg. value1|value2|value3

      • also, make sure that the checkbox beside "Using Regular Expressions" is checked

      The above will allow a form section to appear if one of many possible choices is given from a different/previous part of the form.

      Does that help?

      - Greg

      PS. Julian's link shows you which aspect of the form creation to implement the above. gw

      1. Julian, Gregory, thanks for answering. I had seen that procedure before, but in the Joget installation I have (version 3.0.0 community) I don´t see the check box and the procedure does not work when I add the values ??1|2|3 etc.. Update is required?