Copy link to clipboard
Copied
Hi. I'm a true beginner with script in Adobe forms so I'm hoping someone can help. I'm designing a form for in-processing (on-boarding) new employees and am trying to get radio buttons to select N/A based on the employee type. Certain employee types don't need to in-process all sections or areas within a section, which is why I want to fill N/A when selected.
The other radio buttons are "Yes" and "No", with "No" being the default, until they've in-processed something.
I've tried to figure this out on my own but am not getting anywhere so I appreciate any help.
Copy link to clipboard
Copied
Move your script to validation and use radio button group field name not their choices, something like this:
if (event.target.value=="Military") {
this.getField("Group1").value = "NA1";
There is no "Military" and "Civilian" in dropdown as choices.
Also you can't use "" for radio button to set it to default, I belive you want it to set to N/A then you should use "NA1".
Try using this script as 'Validation' of dropdown field and in dropdown field -> options tab check 'Commit selected value immediately' this is important to do.
Here is script:
if(event.value=="Military")
this.getField("Group1").value = "NA1";
else if (event.value=="Civilian")
this.getField("Group1").value = "Yes1";
else
this.getField("Group1").value = "No1";
Here is also your files with changes already made, let me know if it needs to change anything (I added "Military" and "Civilian" to dropdown for example purpose:
https://drive.google.com/uc?export=download&id=1pI3MolSLEu2aWIKh3omc0Olh_kpeiljk
Copy link to clipboard
Copied
Move your script to validation and use radio button group field name not their choices, something like this:
if (event.target.value=="Military") {
this.getField("Group1").value = "NA1";
There is no "Military" and "Civilian" in dropdown as choices.
Also you can't use "" for radio button to set it to default, I belive you want it to set to N/A then you should use "NA1".
Try using this script as 'Validation' of dropdown field and in dropdown field -> options tab check 'Commit selected value immediately' this is important to do.
Here is script:
if(event.value=="Military")
this.getField("Group1").value = "NA1";
else if (event.value=="Civilian")
this.getField("Group1").value = "Yes1";
else
this.getField("Group1").value = "No1";
Here is also your files with changes already made, let me know if it needs to change anything (I added "Military" and "Civilian" to dropdown for example purpose:
https://drive.google.com/uc?export=download&id=1pI3MolSLEu2aWIKh3omc0Olh_kpeiljk
Copy link to clipboard
Copied
Nesa,
Thank you so much. I know I had a rough draft, but your script was very helpful. I'm able to start building out my form from here.
Thank you again for the help.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more