I've been looking around but haven't come across any information regarding using JavaScript with PDF form applications. If I missed something, I apologize and would appreciate any guidance.
Currently, I have 5 radio buttons that are synchronized - when one is selected, the others should be deselected. My goal is to display specific form cells in a PDF based on which radio button is selected.
Here's where I am at the moment: The script for the radio button is set to mouse-up. When one radio button is selected, Text2 appears as intended. However, even if another radio button is selected, Text2 remains visible until I reselect the initial radio button.
I want to show only certain cells depending on the selected radio button, hiding the rest.
If someone could provide me with a simple example, I can take it from there. Thank you.
if (this.getField("Text2").display == display.hidden)
{
this.getField("Text2").display = display.visible;
}
else
{
this.getField("Text2").display = display.hidden;
}
Edit: Grammar issue corrected. Update: This is my current objective.
if (this.SELECTED("Choice4")){
this.getField("Text4").display = display.visible;
}
else {
this.getField("Text4").display = display.hidden;
}
Update 2: The previous code did not work either.
if(document.getElementByI("Choice3").checked){
this.getField("Text4").display = display.visible;
}
else {
this.getField("Text4").display = display.hidden;
}