|
I have a very basic character quiz that I've made based on other ones I've seen and used the same scripting. They all have a function in the head that is called upon in the form to display the proper result page. My "button" that should run the program doesn't seem to do anything. Please help. Source code is below:
----------------------------------------------------------------------------
----------------------------------------------------------------------------
<b>Inside the head.......</b>
for (i = 0; i < f.nine.length; i++) if (f.nine.checked) value = f.nine.value;
if (value == "1") { gamb++; cyclo++; ice++; angel++; jugg++; forge++;}
if (value == "2") { profx++; wolv++; saber++; colos++; night++;}
if (value == "3") { apoc++; beast++; magn++; sinis++; profx; wolv++; saber++; colos++; night++;}
for (i = 0; i < f.ten.length; i++) if (f.ten.checked) value = f.ten.value;
if (value == "1") { profx++; cyclo++; ice++; angel++; beast++; magn++; night++; forge++; sinis++; }
if (value == "2") { wolv++; saber++; apoc++; gamb++: colos++; jugg++; }
for (i = 0; i < f.eleven.length; i++) if (f.eleven.checked) value = f.eleven.value;
if (value == "1") { profx++; apoc++; cyclo++; ice++; angel++; beast++; magn++: night++; forge++;}
if (value == "2") { wolv++; saber++; gamb++; colos++; jugg++; sinis++; }
var out = "profx";
i = profx;
if (profx > i) { out = "profx"; i = profx; }
if (wolv > i) { out = "wolv"; i = wolv; }
if (saber > i) { out = "saber"; i = saber; }
if (apoc > i) { out = "apoc"; i = apoc; }
if (gamb > i) { out = "gamb"; i = gamb; }
if (cyclo > i) { out = "cyclo"; i = cyclo; }
if (ice > i) { out = "ice"; i = ice; }
if (beast > i) { out = "beast"; i = beast; }
if (colos > i) { out = "colos"; i = colos; }
if (magn > i) { out = "magn"; i = magn; }
if (jugg > i) { out = "jugg"; i = jugg; }
if (night > i) { out = "night"; i = night; }
if (forge > i) { out = "forge"; i = forge; }
if (angel > i) { out = "angel"; i = angel; }
if (sinis > i) { out = "sinis"; i = sinis; }
location.href = out + ".html";
}
function err(msg, url, line)
{
location.href = "error.html";
}
//window.onerror = err;
// -->
</SCRIPT>
<b>
Inside the form I have a number of questions such as......
</b>
11. Are you more clean/organized or messy?
<input type="radio" name="eleven" value="1">
Clean<br />
<input type="radio" name="eleven" value="2">
Messy<br />
Before the form ends I have....
<INPUT type="button" value="Who Am I?" onClick="process();">
----------------------------------------------------------------------------
----------------------------------------------------------------------------
I've seen multiple sites have this same layout and their buttons work perfectly in any browser. I know javascript is enabled, but don't know why this isn't working. The page is in html, not asp if that matters. I appreciate your time.
|
|
|
Your html is a mix of xhtml and html, pick 1.
I see no function called "process" and onClick should all be lower case (ie. "onclick") and I'm assuming the form you are using has the beginning and ending form tag.
Also saying that it works in other browsers doesn't tell us what browser or version of browser it was.
|
|
|
|
|
|
|
// |