I need help with Javascript. I know nothing about it and searching the web is giving me a headache! What I am trying to do seems simple enough, but I have no idea how to make it work.
I am creating a pdf form that will be used on a Tablet by my client. There will be a series of questions that he will use a Stylus pen to choose an answer. Most questions will be yes or no.
What I would like to do is create a form that does this. If he chooses "yes", then the question turns "green".
If he chooses "no", then the question turns "red".
I have learned that if the question is part of the text in the pdf, then this type of operation can't be done. What if I create a form and put each individual question into a form field. Then, based on the action of clicking "yes" or "no", another action will happen that will change the color of the "question" form field.
Will this work using Javascript?
And, if it will work, can I cause multiple form fields to turn red or green based on that same answer? In other words, some of the questions will have a blank that he will type in more information to explain the yes or no answer. Can I use the "yes" or "no" action to not only turn the "question" red or green, but to additionally turn another form field red or green?
This just seem so simple, but I cannot find the answer. Oh, BTW, the original pdf will be designed as a table in InDesign.
Please offer any suggestions and/or solutions.
THANK YOU!!!
//Get the field named "Rad.YesNo". Change the name of the field to match your naming convention
var myRad = getField("Rad.YesNo");
//If the Yes radio button is checked then make the color of the text black.
if(myRad.value == "Yes")
{
getField("Txt.Wahoo2").textColor = color.black;
}
//If the No radio button is checked then make the color of the text red.
if(myRad.value == "No")
{
getField("Txt.Wahoo2").textColor = color.red;
}
Make sure each radio button in the group has a value assigned to it. You assign values to radio buttons and check boxes in the Options tab of the field properties dialog.
StevenD