I am starting with Javascript / jQuery and I hope someone can help me with the following:
I have a simple form (7 questions, 3 switches / answers to a question - except for question 5 with 8 possible options) and based on the selected answers, when the user clicks "view-advice", I want to display the corresponding tips (a combination of 38 possible tips) below the form. I gave the values ββ"a", "b", "c", ... for the radio buttons, and I collect them in an array. The part where the script warns that the array is working fine. I cannot figure out where I show the tips depending on the values ββin the array.
I would be grateful for your help! Thank!
Here is the code:
var laArray = new Array();
$('.button-show-advice').click(function(){
$(":radio:checked").each(function(i){
laArray[i] = $(this).val();
if (laArray == ["a","d","g","j","m","u"]) {
$("#advice-container, #advice1, #advice2").show();
};
})
alert(laArray)
})