| | |
Javascript for an online quiz...
Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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 when you 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...) </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 -->
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 when you 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...) </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 -->
You need to put the name of the form so change the form tag to include name="quiz" like this:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<form name="quiz" action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">
Life... Is a Moment
•
•
•
•
You need to put the name of the form so change the form tag to include name="quiz" like this:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<form name="quiz" action="javascript:finish();" enctype="application/x-www-form-urlencoded" method="get">
You just replace the form tag that u have.
Here is the entire code i used, i have only tested it in firefox
Here is the entire code i used, i have only tested it in firefox
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<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 when you 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...) </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 -->
Life... Is a Moment
Okay, i replaced it with what you had there. But it takes me to my 404 page when you click 'Finish', the page extensions should be:
http://www.fedtech.com/waterjet-cutting
http://www.fedtech.com/laser-cutting
http://www.fedtech.com/water-only
for the results landing pages..
but you got me much closer to where i need to be! thanks!
http://www.fedtech.com/waterjet-cutting
http://www.fedtech.com/laser-cutting
http://www.fedtech.com/water-only
for the results landing pages..
but you got me much closer to where i need to be! thanks!
Last edited by Techie08; Sep 1st, 2009 at 10:43 am.
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:
replace that line with this one:
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"
i think if u remove this part of the code then it should work:
towards the end of the javascript code locate this line:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
location = results[j[0]]+ext;
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
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"
Life... Is a Moment
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 when you 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['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]]) 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) else if(j[0]==0) else }
// --></script>
<!-- end quiz script --><!-- begin quiz html --><form action="javascript<b></b>: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...) </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-->
<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 when you 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['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]]) 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) else if(j[0]==0) else }
// --></script>
<!-- end quiz script --><!-- begin quiz html --><form action="javascript<b></b>: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...) </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:
Were u still getting 404 errors after u edited the code, or did it completely break?
Also i see you have removed some stuff in the javascript code, use this code:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
<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 when you 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...) </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?
Life... Is a Moment
I used that code, you can see it on the page:
www.fedtech.com/cutting-quiz
but it still doesn't redirect.. its beyond me as to why!
www.fedtech.com/cutting-quiz
but it still doesn't redirect.. its beyond me as to why!
![]() |
Similar Threads
- Online exam & Quiz (ASP.NET)
- Need help in creating online exam using jsp (JSP)
- Online examination system (JSP)
- unix little quiz (Shell Scripting)
- Iraq Rules of Engagement Online Quiz (Geeks' Lounge)
- how to develop online test (ASP.NET)
- Generating clientside javascript (ASP)
- Javascript problems (Windows NT / 2000 / XP)
- Please do an online questionnaire. (Geeks' Lounge)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Ajax help please...
- Next Thread: list of event types for listeners?
| Thread Tools | Search this Thread |
Tag cloud for JavaScript / DHTML / AJAX
ajax ajaxexample ajaxjspservlets array autoplay blackjack browser captchaformproblem checkbox child class close codes date debugger dependent developer disablefirebug dom editor element embed engine events explorer ext file firefox flash form forms game gears getselection google gxt hiddenvalue highlightedword hint html ie7 ie8 iframe internet java javascript javascripthelp2020 jquery jsf jsfile jsp jump libcurl maps marquee masterpage math matrixcaptcha media mysql object onerror onmouseoutdivproblem onreadystatechange parent passing paypal pdf php player position post programming rated redirect runtime safari scriptlets scroll search security session shopping size software solutions star stars stretch synchronous toggle tweet unicode variables web webkit webservice window wysiwyg \n





