Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

Hidden Fields and multiple answers

Avatar

Former Community Member

Hi,

I have a form which consists of drop down lists and hidden fields, depending on the answer to the drop down, then a hidden field will appear. What I am struggling to work out is how to code if a user answers Yes to the first drop down, this then prompts a further drop down, which when answered will open 3 more fields.

Example

Question 1 Individual or Company     Answer Individual/Company

Question 2 Is this a new client     Answer Yes/No

(if user has answered No then this can prompt a different set of questions depending on what the user answered to question 1)

For Individual the following question would be asked

Question Do we require proof of address

For Company the following question would be asked

Question Do we require Company Registration

How can I hide the fields initially and only show them depending on the combination of answer.

Any help would be appreciated

Thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I created a simple sample for you. Note that the code that shows and hides is on th eexit event of the DDLists. I put the parts of teh Proof of Address into a subform and I only have to hide the subform to hide all of its child components ...I do not have to hide each individual component of the Proof of Registration object. Also the form must be saved as dynamic for the presence changnes to take effect.

Hope that helps

Paul

View solution in original post

2 Replies

Avatar

Level 10

You will have to use the visible property to hide and display the fields/ sections based on the previous question answer.

I do not have a sample but if you can share your form with few question sections in it then I can help you with that.

Thanks

Srini

Avatar

Correct answer by
Former Community Member

I created a simple sample for you. Note that the code that shows and hides is on th eexit event of the DDLists. I put the parts of teh Proof of Address into a subform and I only have to hide the subform to hide all of its child components ...I do not have to hide each individual component of the Proof of Registration object. Also the form must be saved as dynamic for the presence changnes to take effect.

Hope that helps

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----