austenozzy
12-13-2007, 05:06 PM
Hi there,
I have a form with some questions in it, with the answers in select menus.
I have two possible 'thanks' pages: 'enterprise' and 'express'. There is a hidden field which should contain one of those values.
There are a couple of conditions where the answers should set the value to 'express'; otherwise, they will all be 'enterprise'.
The function is called by an onChange in the third of the three select menus.
Here's the code that isn't currently working :-(
Any help greatly appreciated.
Oz.
----------------------------
<script language="javascript" type="text/javascript">
function ftswitch()
{
var wizardQ1 = document.getElementById("wizardQ1").value;
switch (wizardQ1)
{
case "Fewer than 10":
q1="express";
break
case "10 to 100":
q1="express";
break
default:
q1="enterprise";
}
var wizardQ3 = document.getElementById("wizardQ3").value;
switch (wizardQ3)
{
case "Less than 5k":
q3="express";
break
case "5 to 25k":
q3="express";
break
default:
q3="enterprise";
}
if (q1 = express)
{
document.write("<input type=hidden name=ok_url value=http://www.domain.com/express>");
}
else if (q3 = express)
{
document.write("<input type=hidden name=ok_url value=http://www.domain.com/express>");
}
else
{
document.write("<input type=hidden name=ok_url value=http://www.domain.com/enterprise>");
}
}
</script>
----------------------
I have a form with some questions in it, with the answers in select menus.
I have two possible 'thanks' pages: 'enterprise' and 'express'. There is a hidden field which should contain one of those values.
There are a couple of conditions where the answers should set the value to 'express'; otherwise, they will all be 'enterprise'.
The function is called by an onChange in the third of the three select menus.
Here's the code that isn't currently working :-(
Any help greatly appreciated.
Oz.
----------------------------
<script language="javascript" type="text/javascript">
function ftswitch()
{
var wizardQ1 = document.getElementById("wizardQ1").value;
switch (wizardQ1)
{
case "Fewer than 10":
q1="express";
break
case "10 to 100":
q1="express";
break
default:
q1="enterprise";
}
var wizardQ3 = document.getElementById("wizardQ3").value;
switch (wizardQ3)
{
case "Less than 5k":
q3="express";
break
case "5 to 25k":
q3="express";
break
default:
q3="enterprise";
}
if (q1 = express)
{
document.write("<input type=hidden name=ok_url value=http://www.domain.com/express>");
}
else if (q3 = express)
{
document.write("<input type=hidden name=ok_url value=http://www.domain.com/express>");
}
else
{
document.write("<input type=hidden name=ok_url value=http://www.domain.com/enterprise>");
}
}
</script>
----------------------