Show/Hide entire form based on selection

Adrian M December 20, 2023

I have a confluence page on which I want to create two selection options.

  1. When the first option is selected -> Result: Show a block of content on the page. Hide Confiform.
  2. When the other option is selected -> result: Show Confiform so that the user can submit to create a ticket in Jira (the selection options are not part of the data sent to Jira. ). Hide content block.

I've looked at the "How to show or hide blocks of fields in ConfiForms conditionally" page and other examples. They explain how to show/hide certain fields. I want to show/hide the entire form on the page. Not certain fields within a form.

I don't have the "DIV Container" macro on my list of Confiforms macros. Appreciate any help in how to set this up.

1 answer

0 votes
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2023

Hi

What are you planning to use for creating a " two selection options."?

Alex

Adrian M December 22, 2023

Hi Alex,

I'd like to have a radio group for the user to make the selection. That way if needed I could also add more options for more content blocks or a different form, if needed.

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2023

OK, are you talking about creating one from to offer fields to select and then to show another form based on the selection the user made!?

Is that what you are looking to create

Alex

Adrian M December 22, 2023

Yes, there will be one form with only radio buttons (submit button is not required, of course) for the user to first make a selection. Based on which a content block or input form will be rendered under it on the same page.

It does not necessarily have to be a form with radio buttons to make the selection. I'm open to other suggestions.

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 7, 2024

Sorry, not something what is possible with ConfiForms on Confluence cloud... 

Best option is to create a form that dynamically shows/hides fields based on the options/values selected in other fields

Like Adrian M likes this
Adrian M January 10, 2024

Is there a way to disable the Submit/Save button based on the options/values selected in other fields?

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 10, 2024

No on cloud, sorry... but we probably can add this feature... however, adding a validation (including custom conditional validation rules) for your form should do the same trick in the end

Like Adrian M likes this
Adrian M April 12, 2024

Is there a way to show a block of content within the form fields based on a radio button selection within the same form? I don't have the DIV macro. Is there another macro that can do this?

Example:

Radio option1: Select A
Radio option2: Select B

When A is selected show a block of content under it "You have chosen Selection A"

Similarly, when B is selected show a block of content under it "You have now chosen Selection B"

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 13, 2024

It doe snot have to be a div macro, but something what offers a "container" and is possible for ConfiForms to target via selector.

I think this is still possible with a section macro on Confluence cloud, but you will still need to ask Atlassian team to enable a legacy editor (which works absolutely well with nested bodied macros)

I can share a little example that you can import with ConfiForms (as long as you have enabled support for storage format in app settings)

<p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="a8aecc8d-43e1-4c74-a54c-04d023f2e9e6"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="1df04b70-6eee-47c6-932d-34dd0dde9ef4"><ac:parameter ac:name="fieldName">t1</ac:parameter><ac:parameter ac:name="fieldLabel">t1</ac:parameter><ac:parameter ac:name="type">text</ac:parameter><ac:parameter ac:name="macroHash">-266532898</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="f5726a23-25b6-4c30-8327-ab086ef06654"><ac:parameter ac:name="fieldName">t2</ac:parameter><ac:parameter ac:name="fieldLabel">t2</ac:parameter><ac:parameter ac:name="type">text</ac:parameter><ac:parameter ac:name="macroHash">-1482709600</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="837b835d-9a53-4818-8e46-82d1decd44b8"><ac:parameter ac:name="fieldName">t3</ac:parameter><ac:parameter ac:name="fieldLabel">t3</ac:parameter><ac:parameter ac:name="type">textarea</ac:parameter><ac:parameter ac:name="macroHash">516122927</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="3b80c490-35d5-4102-9ba8-4159ad50b5c0"><ac:parameter ac:name="fieldName">showHide</ac:parameter><ac:parameter ac:name="fieldLabel">showHide</ac:parameter><ac:parameter ac:name="type">checkbox</ac:parameter><ac:parameter ac:name="macroHash">-1646235784</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="fedeaf9e-3cb8-4298-8e6d-08e84c66a1cc"><ac:parameter ac:name="condition">showHide:true</ac:parameter><ac:parameter ac:name="action">Hide container</ac:parameter><ac:parameter ac:name="actionFieldName">showHide</ac:parameter><ac:parameter ac:name="values2">div[data-macro-id=&quot;0b5882f2-eac3-4f3d-80ff-394f4f2ad92d&quot;]</ac:parameter><ac:parameter ac:name="withReverseRule">true</ac:parameter><ac:parameter ac:name="macroHash">1851281688</ac:parameter></ac:structured-macro></p><p><br /></p></ac:rich-text-body></ac:structured-macro><p><br /></p><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="80e7c539-ed78-4311-a36f-07748357e4d7"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="section" ac:schema-version="1" ac:macro-id="154894ae-f015-4c3f-91c4-ffea91afc824"><ac:rich-text-body><p>Section 1:&nbsp;</p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="18f4e9ea-a3f8-44cd-8ad2-57e6184db6ae"><ac:parameter ac:name="fieldName">t1</ac:parameter><ac:parameter ac:name="withLabel">true</ac:parameter><ac:parameter ac:name="macroHash">703343224</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="8f5975e8-8b65-4861-bba2-51724c6cf84a"><ac:parameter ac:name="fieldName">showHide</ac:parameter><ac:parameter ac:name="withLabel">true</ac:parameter><ac:parameter ac:name="macroHash">579835030</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro><p class="auto-cursor-target"><br /></p><ac:structured-macro ac:name="section" ac:schema-version="1" ac:macro-id="0b5882f2-eac3-4f3d-80ff-394f4f2ad92d"><ac:rich-text-body><p>section 2</p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="aba02256-6ee7-402a-9dc2-8170213a02bd"><ac:parameter ac:name="fieldName">t2</ac:parameter><ac:parameter ac:name="withLabel">true</ac:parameter><ac:parameter ac:name="macroHash">294518999</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="62d72305-90a3-4427-a9fe-621c452a55fe"><ac:parameter ac:name="fieldName">t3</ac:parameter><ac:parameter ac:name="withLabel">true</ac:parameter><ac:parameter ac:name="macroHash">-114305226</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro><p><br /></p><p><br /></p></ac:rich-text-body></ac:structured-macro><p class="auto-cursor-target"><br /></p><p><br /></p>

Alex

Like Adrian M likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events