-i am not sure whether input[type="text"] should be used in array number question.
- "PetNumber" is the number can be selected in q1, before the "pet type", from 1-20.
- change() function is actived when user make the selection, key problem here, i don't know how to involve selction element into function and calculation.
Code:
$(this).closest('td').find('input[type="text"]').val(legPerPet.val*PetNumber.val);
say you select dog, every dog has 4 legs(legPerPet), then total legs=PetNumber*legPerPet.if you have 2dogs, means 8 will be stored in mysql.then q1_SQ001_N1 will be displayed as 8 in q2.
q1_SQ001_N1 is calculated by legPerPet.val*PetNumber and store in mysql.
-when i select "legPerPet",how to involve into javascript?