I'm trying to build a quiz that takes the answers given and when you hit submit, it totals the number of items in each category and sends you to a specified page...

It's basically perfect except one thing... it doesnt take you to a page when the totals are added up, it just says "Error on page" at the bottom of the screen.

Here's the script:

<p><span style="font-size: small;">Your project needs to get started, but where do you start? Should you use waterjet or laser cutting? What if your material is thick? Take the quiz below and find out what cutting method is best for completing your project!</span></p>
<p><span style="font-size: small;">The Cutting Method Assessment is the perfect tool to help you decide which path to take&nbsp;when you&nbsp;start manufacturing your parts.</span></p>
<!-- begin quiz script -->
<script type="text/javascript"><!--
function finish() {
    var ext = '.html';
    var results = new Array("none","Waterjet Cutting","Laser Cutting","Water-Only Cutting","Machining or Value-Added","You're Out of Luck");
    var nums = new Array(6);
    for(var i = 0; i < nums.length; i++) nums[i] = 0;
    for(var i = 1; i <= 7; i++) {
        var q = document.forms['quiz'].elements['question_'+i];
        if(q[0].type=='checkbox') {
            var n = 0;
        }
        for(var j = 0; j < q.length; j++) {
            if(q[j].checked) {
                var a = q[j].value.split(',');
                for(var k = 0; k < a.length; k++) {
                    nums[a[k]]++;
                }
                if(q[j].type=='radio') break;
                else n++;
            }
            if(j == q.length-1&&q[j].type=='radio') {nums[0]++;}
        }
        if(q[0].type=='checkbox'&&((document.forms['quiz'].elements['question_'+i+'_min']&&n<document.forms['quiz'].elements['question_'+i+'_min'].value)||(document.forms['quiz'].elements['question_'+i+'_max']&&n>document.forms['quiz'].elements['question_'+i+'_max'].value))) nums[0]++;
    }
    var j = new Array('0');
    for (i in nums) if(nums[i]>nums[j[0]]){j=new Array(''+i);} else if(nums[i]==nums[j[0]])j[j.length] = i;
    //var o = '';for(var i in results)o+=results[i]+'='+nums[i]+'\n';
    //alert(o);
    if(nums[0]!=0) {
        alert('You missed or incorrectly answered '+nums[0]+' questions!');
    }
    else if(j[0]==0) {
        alert('No result could be determined.');
    }
    else {
        location = results[j[0]]+ext;
    }
}
// --></script>
<!-- end quiz script --><!-- begin quiz html --><form action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>What type of material are you using?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,2" /> Aluminum (6061, 7075, 2024...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="2" /> Carbon Steel (A36, A1011, 4140, 1075...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Composite Material (Fiberglass, G10, Kevlar, Graphite...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,4" /> Armor Plating or Ballistic Material (HH, AR400, HY80/100...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Rubber (Foam, Silicone, Urethane, Vinyl...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Exotic Metal (Tantalum, Rhenium, Molybdenum...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Steel Alloy (Hastelloy, Inconel, Titanium...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Plastic (Acrylic, Delrin, Nylon, UHMW...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Red Metals (Copper, Brass, Bronze...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Misc. Material (Glass, Slate, Tile, Wood, Cork, Mesh...)&nbsp; </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How thick is your material?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="2" /> 0 to 5/8" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1,3" /> 3/4" to 2" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1" /> 2.125" to 12" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="5" /> Over 12" thick </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How tight of tolerances do you need to hold?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2" /> Very Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2,3" /> Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="1" /> The tighter the better but it's not a big deal </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Does minor heat matter in the case of your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,3" /> Yes, I can't have any heat in the mix </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,2,3,4" /> No, it doesn't matter </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="5" /> I'm not sure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How intricate are the details in your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="2,4" /> Very intricate and detailed </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3" /> It's detailed, but nothing too extreme </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,3" /> Minor detail </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3,4" /> None, it's just a regular shape </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Will your project require a fine finish, forming or other machining?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="2" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="1,3" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Is your material white, or porous?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="3" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="1,2,4" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br /><input type="submit" value="Finish" /> <input type="reset" value="Reset" /> </form><!-- end quiz html -->

Recommended Answers

All 13 Replies

You need to put the name of the form so change the form tag to include name="quiz" like this:

<form name="quiz" action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">

You need to put the name of the form so change the form tag to include name="quiz" like this:

<form name="quiz" action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">

Do i put this at the end, or the beginning? Thanks!!

Crap. Well i tried both but neither worked at the beginning or the end :(

You just replace the form tag that u have.
Here is the entire code i used, i have only tested it in firefox

<p><span style="font-size: small;">Your project needs to get started, but where do you start? Should you use waterjet or laser cutting? What if your material is thick? Take the quiz below and find out what cutting method is best for completing your project!</span></p>
<p><span style="font-size: small;">The Cutting Method Assessment is the perfect tool to help you decide which path to take&nbsp;when you&nbsp;start manufacturing your parts.</span></p>
<!-- begin quiz script -->
<script type="text/javascript"><!--
function finish() {
var ext = '.html';
var results = new Array("none","Waterjet Cutting","Laser Cutting","Water-Only Cutting","Machining or Value-Added","You're Out of Luck");
var nums = new Array(6);
for(var i = 0; i < nums.length; i++) nums[i] = 0;
for(var i = 1; i <= 7; i++) {
var q = document.forms['quiz'].elements['question_'+i];
if(q[0].type=='checkbox') {
var n = 0;
}
for(var j = 0; j < q.length; j++) {
if(q[j].checked) {
var a = q[j].value.split(',');
for(var k = 0; k < a.length; k++) {
nums[a[k]]++;
}
if(q[j].type=='radio') break;
else n++;
}
if(j == q.length-1&&q[j].type=='radio') {nums[0]++;}
}
if(q[0].type=='checkbox'&&((document.forms['quiz'].elements['question_'+i+'_min']&&n<document.forms['quiz'].elements['question_'+i+'_min'].value)||(document.forms['quiz'].elements['question_'+i+'_max']&&n>document.forms['quiz'].elements['question_'+i+'_max'].value))) nums[0]++;
}
var j = new Array('0');
for (i in nums) if(nums[i]>nums[j[0]]){j=new Array(''+i);} else if(nums[i]==nums[j[0]])j[j.length] = i;
//var o = '';for(var i in results)o+=results[i]+'='+nums[i]+'\n';
//alert(o);
if(nums[0]!=0) {
alert('You missed or incorrectly answered '+nums[0]+' questions!');
}
else if(j[0]==0) {
alert('No result could be determined.');
}
else {
location = results[j[0]]+ext;
}
}
// --></script>
<!-- end quiz script --><!-- begin quiz html --><form name="quiz" action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>What type of material are you using?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,2" /> Aluminum (6061, 7075, 2024...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="2" /> Carbon Steel (A36, A1011, 4140, 1075...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Composite Material (Fiberglass, G10, Kevlar, Graphite...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,4" /> Armor Plating or Ballistic Material (HH, AR400, HY80/100...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Rubber (Foam, Silicone, Urethane, Vinyl...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Exotic Metal (Tantalum, Rhenium, Molybdenum...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Steel Alloy (Hastelloy, Inconel, Titanium...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Plastic (Acrylic, Delrin, Nylon, UHMW...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Red Metals (Copper, Brass, Bronze...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Misc. Material (Glass, Slate, Tile, Wood, Cork, Mesh...)&nbsp; </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How thick is your material?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="2" /> 0 to 5/8" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1,3" /> 3/4" to 2" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1" /> 2.125" to 12" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="5" /> Over 12" thick </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How tight of tolerances do you need to hold?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2" /> Very Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2,3" /> Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="1" /> The tighter the better but it's not a big deal </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Does minor heat matter in the case of your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,3" /> Yes, I can't have any heat in the mix </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,2,3,4" /> No, it doesn't matter </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="5" /> I'm not sure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How intricate are the details in your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="2,4" /> Very intricate and detailed </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3" /> It's detailed, but nothing too extreme </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,3" /> Minor detail </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3,4" /> None, it's just a regular shape </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Will your project require a fine finish, forming or other machining?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="2" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="1,3" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Is your material white, or porous?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="3" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="1,2,4" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br /><input type="submit" value="Finish" /> <input type="reset" value="Reset" /> </form><!-- end quiz html -->

404 normally means that a page doesnt exist.
i think if u remove this part of the code then it should work:
towards the end of the javascript code locate this line:

location = results[j[0]]+ext;

replace that line with this one:

location = results[j[0]];

also ensure that the names in the array are the same as where u want them to go for example i can see in the code that you have to change the name in the array(var results), where u see "Waterjet Cutting" to "waterjet-cutting"

Alright. So i made those adjustments... here is the final script but it's still not going to those pages? Maybe i goofed.

<h1>Cutting Method Assessment</h1>
<p><span style="font-size: small;">Your project needs to get started, but where do you start? Should you use waterjet or laser cutting? What if your material is thick? Take the quiz below and find out what cutting method is best for completing your project!</span></p>
<p><span style="font-size: small;">The Cutting Method Assessment is the perfect tool to help you decide which path to take&nbsp;when you&nbsp;start manufacturing your parts.</span></p>
<!-- begin quiz script -->
<script type="text/javascript"><!--
function finish() for(var j = 0; j < q.length; j++) if(q[j].type=='radio') break;
else n++;
}
if(j == q.length-1&&q[j].type=='radio') }
if(q[0].type=='checkbox'&&((document.forms.elements&&n<document.forms.elements.value)||(document.forms.elements&&n>document.forms.elements.value))) nums[0]++;
}
var j = new Array('0');
for (i in nums) if(nums>nums[j[0]]) else if(nums==nums[j[0]])j[j.length] = i;
//var o = '';for(var i in results)o+=results+'='+nums+'\n';
//alert(o);
if(nums[0]!=0) else if(j[0]==0) else }
// --></script>
<!-- end quiz script --><!-- begin quiz html --><form action="javascript&lt;b&gt;&lt;/b&gt;:finish();" enctype="application/x-www-form-urlencoded" method="get">
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>What type of material are you using?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,2" /> Aluminum (6061, 7075, 2024...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="2" /> Carbon Steel (A36, A1011, 4140, 1075...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Composite Material (Fiberglass, G10, Kevlar, Graphite...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,4" /> Armor Plating or Ballistic Material (HH, AR400, HY80/100...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Rubber (Foam, Silicone, Urethane, Vinyl...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Exotic Metal (Tantalum, Rhenium, Molybdenum...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Steel Alloy (Hastelloy, Inconel, Titanium...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Plastic (Acrylic, Delrin, Nylon, UHMW...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Red Metals (Copper, Brass, Bronze...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Misc. Material (Glass, Slate, Tile, Wood, Cork, Mesh...)&nbsp; </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How thick is your material?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="2" /> 0 to 5/8" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1,3" /> 3/4" to 2" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1" /> 2.125" to 12" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="5" /> Over 12" thick </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How tight of tolerances do you need to hold?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2" /> Very Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2,3" /> Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="1" /> The tighter the better but it's not a big deal </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Does minor heat matter in the case of your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,3" /> Yes, I can't have any heat in the mix </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,2,3,4" /> No, it doesn't matter </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="5" /> I'm not sure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How intricate are the details in your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="2,4" /> Very intricate and detailed </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3" /> It's detailed, but nothing too extreme </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,3" /> Minor detail </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3,4" /> None, it's just a regular shape </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Will your project require a fine finish, forming or other machining?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="2" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="1,3" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Is your material white, or porous?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="3" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="1,2,4" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br /><input type="submit" value="Finish" /> <input type="reset" value="Reset" /> </form><!-- end quiz html --><br />
</div>
<!--PAGE_END-->

Please use the code tags when inserting code, just makes it look neater.

Also i see you have removed some stuff in the javascript code, use this code:

<p><span style="font-size: small;">Your project needs to get started, but where do you start? Should you use waterjet or laser cutting? What if your material is thick? Take the quiz below and find out what cutting method is best for completing your project!</span></p>
<p><span style="font-size: small;">The Cutting Method Assessment is the perfect tool to help you decide which path to take&nbsp;when you&nbsp;start manufacturing your parts.</span></p>
<!-- begin quiz script -->
<script type="text/javascript"><!--
function finish() {
var ext = '.html';
var results = new Array("none","waterjet-cutting","laser-cutting","water-only","Machining or Value-Added","You're Out of Luck");
var nums = new Array(6);
for(var i = 0; i < nums.length; i++) nums[i] = 0;
for(var i = 1; i <= 7; i++) {
var q = document.forms['quiz'].elements['question_'+i];
if(q[0].type=='checkbox') {
var n = 0;
}
for(var j = 0; j < q.length; j++) {
if(q[j].checked) {
var a = q[j].value.split(',');
for(var k = 0; k < a.length; k++) {
nums[a[k]]++;
}
if(q[j].type=='radio') break;
else n++;
}
if(j == q.length-1&&q[j].type=='radio') {nums[0]++;}
}
if(q[0].type=='checkbox'&&((document.forms['quiz'].elements['question_'+i+'_min']&&n<document.forms['quiz'].elements['question_'+i+'_min'].value)||(document.forms['quiz'].elements['question_'+i+'_max']&&n>document.forms['quiz'].elements['question_'+i+'_max'].value))) nums[0]++;
}
var j = new Array('0');
for (i in nums) if(nums[i]>nums[j[0]]){j=new Array(''+i);} else if(nums[i]==nums[j[0]])j[j.length] = i;
//var o = '';for(var i in results)o+=results[i]+'='+nums[i]+'\n';
//alert(o);
if(nums[0]!=0) {
alert('You missed or incorrectly answered '+nums[0]+' questions!');
}
else if(j[0]==0) {
alert('No result could be determined.');
}
else {
location = results[j[0]];
}
}
// --></script>
<!-- end quiz script --><!-- begin quiz html --><form name="quiz" action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>What type of material are you using?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,2" /> Aluminum (6061, 7075, 2024...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="2" /> Carbon Steel (A36, A1011, 4140, 1075...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Composite Material (Fiberglass, G10, Kevlar, Graphite...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,4" /> Armor Plating or Ballistic Material (HH, AR400, HY80/100...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Rubber (Foam, Silicone, Urethane, Vinyl...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Exotic Metal (Tantalum, Rhenium, Molybdenum...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Steel Alloy (Hastelloy, Inconel, Titanium...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Plastic (Acrylic, Delrin, Nylon, UHMW...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1" /> Red Metals (Copper, Brass, Bronze...) </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_1" type="radio" value="1,3" /> Misc. Material (Glass, Slate, Tile, Wood, Cork, Mesh...)&nbsp; </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How thick is your material?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="2" /> 0 to 5/8" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1,3" /> 3/4" to 2" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="1" /> 2.125" to 12" </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_2" type="radio" value="5" /> Over 12" thick </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="background-color: #ffffff; width: 100%; border: #ffffff 0px solid;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How tight of tolerances do you need to hold?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2" /> Very Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="2,3" /> Tight </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_3" type="radio" value="1" /> The tighter the better but it's not a big deal </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Does minor heat matter in the case of your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,3" /> Yes, I can't have any heat in the mix </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="1,2,3,4" /> No, it doesn't matter </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_4" type="radio" value="5" /> I'm not sure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>How intricate are the details in your project?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="2,4" /> Very intricate and detailed </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3" /> It's detailed, but nothing too extreme </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,3" /> Minor detail </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_5" type="radio" value="1,2,3,4" /> None, it's just a regular shape </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Will your project require a fine finish, forming or other machining?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="2" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="1,3" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_6" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br />
<table style="width: 100%;" border="0" cellspacing="0" cellpadding="5">
<tbody>
<tr>
<td width="34%"><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><strong>Is your material white, or porous?</strong> </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="3" /> Yes </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="1,2,4" /> No </span></span></td>
</tr>
<tr>
<td><span style="font-family: Verdana, Arial, Helvetica, sans-serif;"><span style="font-size: small;"><input name="question_7" type="radio" value="5" /> Unsure </span></span></td>
</tr>
</tbody>
</table>
<br /><input type="submit" value="Finish" /> <input type="reset" value="Reset" /> </form><!-- end quiz html -->

Were u still getting 404 errors after u edited the code, or did it completely break?

Please use the code that I inserted above in the thread, u have removed extra stuff from the code, which has resulted in the javascript function not being complete.

Try and use the firefox browser with the firebug add-on, this helps greatly when working with javascript, it will tell u exactly what the error is.

I've copied and pasted the exact code, but firefox isn't giving me much to go off of with where i'm going wrong

So i took the quiz located on the link that u provided in an earlier post, and i was able to be redirected to the correct page, no error, i had chosen all the first options, which took me to the laser cutting page.

Is a certain option giving u a problem?

Why unnecessarily you are putting so much of effort, when you can easily do such stuffs with DOM manipulation. If you strictly want to rediect to a page and display the result there then use cookies.
Otherwise you can display the score on the same page with DOM manipulation. Check this link to know more. Dynamic Quiz Using JavaScript

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.