Paul thank you for the answer. I wanted that the user should enter value in the INPUT FIELD from 1 to 4
Now here is the FIXED WEIGHTAGE for each INPUT FIELD is for
1 => 5
2 => 3
3 => 1
4 => 1
So once the user enters the 1 in INPUT FIELD then, automatically the FIXED WEIGHTAGE should be updated accordingly. like if INPUT FIELD 1 then FIXED WEIGHTAGE be 5 and so on.
The calculated weighted score is addition of INPUT FIELD + FIXED WEIGHTAGE
and last the FIXED WEIGHTAGE is added and written in Total and also Calculated weighted score is added and DIVIDED by Fixed WeightageTotal and quotient is written
var myMap = new Map();
myMap.set("1", "5");
myMap.set("2", "4");
myMap.set("3", "1");
myMap.set("4", "1");
// pass variable to field
function passit1() {
var newtext = document.form.input1.value;
document.form.output1.value=myMap.get(newtext );
}
function passit2(){
var newtext = document.form.input2.value;
document.form.output2.value=myMap.get(newtext );
}
The weightage, calculated, and totals all update when changes occur
Scores that result in unknown weightage values are not accepted, returning back to what they were
You’ll note that the above was built on top of the previous concept from before. It should be fairly easy to expand the code so that it can accept a potentially large number of scores.