...

View Full Version : How to solve this...



sxscorpio76
02-25-2012, 05:32 PM
1)HOW TO SET THE DECIMAL TO 1 OR 2 POINT ONLY
2)HOW TO MAKE SURE ALL THE QUESTIONS ANSWERED B4 PERCENTAGE IS CALCULATED
why it is not working in firefox?
HERE IS THE EDITED CODE.

var numOfGroups = 12;

function calc() {
var score = 0;
for (var j=1; j<=numOfGroups; j++) {
var f = document["myform"]["ques"+j];
for (var i=0; i<f.length; i++) {
if (f[i].checked) {
score += Number(f[i].value /72 *100);
}
}
}
//confused here..do i need to create new function somenthing like this
function showScore() {
if(answered != answers.length) {
alert("You have not answered all of the questions yet!");
return false; OR
}

//if numOfGroups != 12 {

alert("You have not answered all of the questions yet!");
}
else{

alert ("Your Score is " + score);
return false;


}
</script>

Philip M
02-25-2012, 06:19 PM
Why have you started a new thread? :( You have already asked this question at
http://www.codingforums.com/showthread.php?p=1197578#post1197578
Please have a look at the forum rules.

sxscorpio76
02-25-2012, 06:42 PM
sorry how to delete this.................



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum