Need help creating an array of data to display as an app alert
I have radio boxes named 1,2,3,4. I have them set as Yes or No and their value as Choice1/Choice 2.
When a person checks no, I need specific text to store to an array. (Each check box goes to a question and I need the question they checked no to to display later).
At the end, I want to program an action button to display an app.alert that shows the questions that someone checked no to.
For example, if they said no to questions 2 and 4. I want the app alert to display a message that says, you chose No for Do you smoke and Do you drink.
I have combined some code, and I'm not sure if I'm on the right track. I'm new to Java Script and have been looking at other people's questions.
if (getField("1").value=="Choice2") {
var question68 = "You check no for question 68";
}
var emptyFields = [];
for (var i=0; i<this.numFields; i++) {
var f = this.getField(this.getNthFieldName(i));
{
if (f.required && f.value == "") {
emptyFields.push(this.getNthFieldName(i));
}
}
}
if (emtpyFields.length > 0) {
// display an error message based on the emptyFields array
}
Please help! Thank you in advance.
