Hi the below script is not working form me. Please any one help to find the issue.
<!DOCTYPE html>
<html>
<body>
<form method="post" name="input1" onsubmit="return validateinputs()">
<STRONG>Question 1</STRONG>: <br />
<input type="radio" name="q1" value="male" /> choice1<br />
<input type="radio" name="q1" value="female" /> choice2<br />
<STRONG>Question 2</STRONG>: <br />
<input type="radio" name="q2" value="male" /> choice1<br />
<input type="radio" name="q2" value="female" /> choice2<br />
<STRONG>Question 3</STRONG>: <br />
<input type="radio" name="q3" value="male" /> choice1<br />
<input type="radio" name="q3" value="female" /> choice2<br />
<input type="submit" value="Submit" />
</form>
<script language="JavaScript" type="text/javascript">
<!-- Copyright 2001, Sandeep Gangadharan -->
<!-- For more free scripts go to
http://sivamdesign.com/scripts/ -->
<!--
function validateinputs() { // modify the script below to match your needs
var q1_ans, q2_ans, q3_ans;
for (var i=0; i < document.input1.q1.length; i++)
{
if (document.input1.q1[i].checked)
{
q1_ans = document.input1.q1[i].value;
}
}
for (var i=0; i < document.input1.q2.length; i++)
{
if (document.input1.q2[i].checked)
{
q2_ans = document.input1.q2[i].value;
}
}
for (var i=0; i < document.input1.q2.length; i++)
{
if (document.input1.q3[i].checked)
{
q3_ans = document.input1.q1[i].value;
}
}
if(q1_ans=="male" && q2_ans=="male" && q3_ans=="male")
{
window.location = "allmale.html";
return false;
}
}
// -->
</script>
</body>
</html>