Copy link to clipboard
Copied
I need to add a child question for when the User answers yes to a parent question, can this be done?
Specific scenario - A User answers yes to the question and is then presented with additional question options. If the User answers no then they move on to the next question on the form.
Copy link to clipboard
Copied
You can do it by show/hide child questions fields until yes/no are selected.
What type of fields do you use?
Copy link to clipboard
Copied
The parent question is a yes/no question so I was using radio buttons but if I need to change that format, I can. The parent just has to be Yes / No and if Yes, then they are presented with 3 options they must choose one of.
Copy link to clipboard
Copied
Are the options also radio buttons?
What are the names of your fields?
Copy link to clipboard
Copied
The parent options are radio buttons as well. The User can only select Yes or No and it's required. Field Names are NaturalDisaster-Y and NaturalDisaster-N. The child options of Yes would be Y-Recovery, Y-Preparation, Y-Response (not in that order)
Copy link to clipboard
Copied
If those are your field names, then place this as 'Custom calculation script' of any text field:
var f = this.getField("NaturalDisaster-Y").valueAsString;
this.getField("Y-Response").display = (f == "Off")? display.hidden : display.visible;
this.getField("Y-Recovery").display = (f == "Off")? display.hidden : display.visible;
this.getField("Y-Preparation").display = (f == "Off")? display.hidden : display.visible;
Addition:
Why are your radio buttons not part of the same group? I assume user should be able to select only one choice, right? You should name parent group "NaturalDisaster" give one button a 'radio button choice' "Yes" and second button choice "No" (you can set 'radio button choice' under 'Options' tab of radio button properties),
name your child group "NDYes" give them different choice (Response, Recovery, Preparation).
That way, users would be able to select only one choice, and in that case use this script:
var f = this.getField("NaturalDisaster").valueAsString;
this.getField("NDYes").display = (f == "Yes")? display.visible : display.hidden;
If for some reason you don't need mutually exclusive buttons disregard 'Addition' part.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now