I have about 10 Yes/No Questions
At the end I have a Radio Button, that I want the results of it to show based on the user's response to the Previous Yes/No Questions (if a person gave certain responses, then the last radio button will show yes, otherwise it will show No)
How can I do this?
Please login or Register to submit your answer
Why are you using a radio button at the end? How are the questions set up? Radio, Checkbox? How are the questions calculated? In other words, if they answer 6 questions as Yes, does Yes appear? What is the logic?
I ask these questions because A WAY TO DO THIS (NOT THE WAY) is you could assign a numerical value to the Yes/No responses of your radio or checkboxes if that is how you are formulating the questions and then add a hidden field that totals that numerical value. Which you could then use to conditionally show Yes Or No because on the total of the answers to the questions.
var x = something here to set the value of your Yes/No
var y = something here to set the value of your Yes/No option 2.... and so on
if(X = "Yes") {
jQuery("#field_key").prop("checked", true);
}else if (X == "Yes" && Y == "No"){
jQuery("#field_key").prop("checked", true);
} else {
jQuery("#field_key").prop("checked", false);
}... and so on
#field_key above represents the CSS ID of the final radio button.