Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Radio Button - Change color if not checked

Avatar

Level 2
I am trying to write the script to display a message and change the color when a field when it is not filled in or a radio button group when the user did not make a choice. I am able to get the text fields working properly, however, I cannot make the radio button group work. It displays the message, but it does not change the color. The code I am using is:



if ((New_Existing.rawValue == null) || (New_Existing.rawValue == "")) {

app.alert("Please check whether this is a New or an Existing document.");

// Change the color of the fillable area of the text field.

xfa.resolveNode("New_Existing.ui.#textEdit.border.edge").stroke = "solid";

xfa.resolveNode("New_Existing.ui.#textEdit.border.fill.color").value = "255,100,50";



// Set the variable to indicate that this field does not contain data.

iVar = 1;

}

else {

// Reset the fillable area of the text field.

xfa.resolveNode("New_Existing.ui.#textEdit.border.edge").stroke = "lowered";

xfa.resolveNode("New_Existing.ui.#textEdit.border.fill.color").value = "255,255,255";

}



"New_Existing" is the name of the radio button group... I know that "#textEdit" is wrong but I don't know what to change it to. I tried "button", I tried "#checkButton" but neither worked.



Any info would be greatly appreciated! Thanks... Jenn D.
2 Replies

Avatar

Level 10
Here is what I use:



RadioButtonName.ui.checkButton.border.fill.color.value

Avatar

Level 2
Thank you, it didn't work though. I found a work around that I have incorporated already however. I created read only text boxes and put them behind my radio buttons. I then call out the text boxes to fill in when the conditions are right. It makes the button appear as if it has a "colored frame" around it. I tried a whole bunch of things yesterday but I have about 20 radio buttons on my form and I needed to get it done quickly so I got creative.



Have a good day! Jenn D.