I need help making form boxes stay red
Hey,
Apologies in advance - I'm an old dog trying to learn new tricks.
I've created a questionnaire using Prepare form, and there are 17 questions, each with a pair of Radio Buttons. I've tried to add a javascript to each one that turns the 'No' option to red if it's selected. I've managed that, but then when any subsequent options are selected, the red disappears and it just returns to transparent. Does anyone know how I can change my code to keep it red? Here's the code I plagiarised from another forum...
// Loop through questions q1 to q17 and apply the color change
for (var i = 1; i <= 17; i++) {
// Define the current radio button group name
var fieldName = "q" + i;
// Get the field object
var field = this.getField(fieldName);
// Check if Choice2 is selected
if (field.value === "Choice2") {
// Change text color of Choice2 to red
field.textColor = color.red;
}
}
Can anyone help? I just have no idea where to start.
Thank you so much!
