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
BedrockMission!

Learn More

View all

Sign in to view all badges

Radio Button - Change color if not checked

Avatar

Avatar
Level 2
_Jenn_Dickens_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Jenn_Dickens_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile
_Jenn_Dickens_
Level 2

18-11-2008

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.

Replies

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct Reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

19-11-2008

Here is what I use:



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

Avatar

Avatar
Level 2
_Jenn_Dickens_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile

Avatar
Level 2
_Jenn_Dickens_
Level 2

Likes

0 likes

Total Posts

18 posts

Correct Reply

0 solutions
View profile
_Jenn_Dickens_
Level 2

19-11-2008

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.