Copy link to clipboard
Copied
hello,
I'm brand new to JavaScript and Adobe form fields,
I create a form with five radio buttons "Option 1, "Individual," "Option 2, "Couple," "Option 3, "Single parent" "Option 4, "Family" "Option 5, "Waives" and a text field" (please specify)".
I want the form to show a text field (please specify)", (and become required if possible) if someone selects the radio button option 5 "Waives", but I don't want it to appear as an option if he chose “Option 1,2,3,4,”.
What is the best way to do this?
Thanks in advance
Copy link to clipboard
Copied
in the future, to find the best place to post your message, use the list here, https://community.adobe.com/
p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.
<"moved from using the community">
Copy link to clipboard
Copied
Let's say radio buttons are named "Group1", (change to your actual name) use this as custom calculation script of text field:
event.target.display = this.getField("Group1").valueAsString === "Waives" ? 0 : 1;
event.target.required = this.getField("Group1").valueAsString === "Waives" ? true : false;
Copy link to clipboard
Copied
thks for your answwer, it not working 😞 let try another trategy,
I have create a form with one check box buttons and one text field..
the checkbox field named "checkBox" and a text field named "textField" , I want to be abble to show the text field when the checkbox is checked and hide it when it's unchecked.
thansk in advance
Copy link to clipboard
Copied
As Mouse Up action of checkbox:
this.getField("textField").display = event.target.value == "Off" ? display.hidden : display.visible;
Copy link to clipboard
Copied
hi, thks it work:) I did the same thing with certain radio buttons. If I accidentally check it and want to clear the form, the checkbox won't become hidden again. Can you assist me with it?
thanks in advance
Copy link to clipboard
Copied
For radio button it won't work like that because you can't uncheck radio button.
You need to use calculation script in text field or hide checkbox with a same button you reset radio buttons.
Check my first post above for calculation script.
Copy link to clipboard
Copied
Thanks it work well!!
Copy link to clipboard
Copied
late say, when selecting a radio button I have to make a series of text fields disappear and display a message behind them. is this possible, if so do you have a formula for me, thank you
Copy link to clipboard
Copied
This one liner will not work.