mocha
03-06-2003, 08:44 PM
Hi,
I am currently working on a quiz script which takes the answers selected and matches them up with one of the possibe results. (What Buffy character are you, etc.)
I understand the basics, but I don't know how to make one value in the script apply to more than one result.
ie
for (i = 0; i < f.one.length; i++) if
(f.one[i].checked) value = f.one[i].value;
if (value == "1") { person1++; }
if (value == "2") { person2++; }
if (value == "3") { person3++; }
if (value == "4") { person4++; }
if (value == "5") { person5++; }
if (value == "6") { person6++; }
Instead, I want (value == "4") to apply for BOTH person4 and person5, how would I go about doing this? Or could someone point me somewhere that would explain?
TIA,
mocha
I am currently working on a quiz script which takes the answers selected and matches them up with one of the possibe results. (What Buffy character are you, etc.)
I understand the basics, but I don't know how to make one value in the script apply to more than one result.
ie
for (i = 0; i < f.one.length; i++) if
(f.one[i].checked) value = f.one[i].value;
if (value == "1") { person1++; }
if (value == "2") { person2++; }
if (value == "3") { person3++; }
if (value == "4") { person4++; }
if (value == "5") { person5++; }
if (value == "6") { person6++; }
Instead, I want (value == "4") to apply for BOTH person4 and person5, how would I go about doing this? Or could someone point me somewhere that would explain?
TIA,
mocha