osterfelder
New Member
I am trying to redirect when each radio checked from both questions.but the following code i have used is not working. \[code\] function chekcSubmitType() { if(document.getElementById('ra').checked, document.getElementById('rc').checked) { window.location="page-1.html"; } if(document.getElementById('ra').checked, document.getElementById('rd').checked) { window.location="page-2.html"; } if(document.getElementById('rb').checked, document.getElementById('rc').checked) { window.location="page-3.html"; } if(document.getElementById('rb').checked, document.getElementById('rd').checked) { window.location="page-4.html"; } }\[/code\]I have separated the both question by using a JavaScript code.\[code\]<form name="myquiz" method="post"><p>Question (1)</p> <span>500</span> <input type="radio" id="ra" value="http://stackoverflow.com/questions/14085576/question1"/> <span>1000</span> <input type="radio" id="rb" value="http://stackoverflow.com/questions/14085576/question1"/><!--I have separated these both by using a JavaScript code--><p>Question (2)</p> <span>1500</span> <input type="radio" id="rc" value="http://stackoverflow.com/questions/14085576/question2"/> <span>2000</span> <input type="radio" id="rd" value="http://stackoverflow.com/questions/14085576/question2"/><input type="button" onClick="chekcSubmitType()" value="http://stackoverflow.com/questions/14085576/Go" /></form>\[/code\]here is what i actually want to do: (r) is stand for radio\[code\]ra + rc redirect to page-1.htmlra + rd redirect to page-2.htmlrb + rc redirect to page-3.htmlrb + rd redirect to page-4.html\[/code\]