Hello
i really need help with javascript function and php.
javascript function in calculate.js–
function CalculateScore(){
var total = 0;
var radios = document.getElementsByTagName(‘input’);
var value = 0;
for (i = 0; i < radios.length; i++) {
if (radios[i].type === ‘radio’ && radios[i].checked) {
value = radios[i].value;
total = (total + value * 1);
}
}
rpt=confirm(“Your score is : “+ total +”\n\nReset form ?”);
}
this function works in html file that i am not allowed to change… so i have to use another php file to get the total scores.
when i call this function in php like
echo "";
it just always shows me confirm box with score = 0.
is there any way i can get “total scores” in some php variable(in php file). instead of using confirm box.
i am really stuck…
Thanks!