I want to redirect different pages depending upon different selections from user, my code is working for one page only & when i select another pages--it hangs & shows the contents of first page only. I have to press back option in browser each time to view the contents of 2, 3, or 4 pages, otherwise it stuck. The Code is
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> </script>
<script type="text/javascript">
function idForm(){
var selectvalue = $('input[name=choice]:checked', '#idForm').val();
if(selectvalue == "all"){
window.open('index.php','_self');
return true;
}
else if(selectvalue == "pc"){
window.open('pc.php','_self');
return true;
}
else if(selectvalue == "ps2"){
window.open('ps2.php','_self');
return true;
}else if(selectvalue == 'ps3'){
window.open('ps3.php','_self');
return true;
}else if(selectvalue == 'psp'){
window.open('psp.php','_self');
return true;
}
return false;
};
</script>
</head>
<body>
Games - This is the full List of Games, if you want to choose the games according to the Platform then select it <br /><br />
<form id="idForm">
<input type="radio" onClick="idForm()" name="choice" value="all" checked/>All
<input type="radio" onClick="idForm()" name="choice" value="pc"/>PC
<input type="radio" onclick="idForm()" name="choice" value="ps2"/>PS2
<input type="radio" onclick="idForm()" name="choice" value="ps3"/>PS3
<input type="radio" onclick="idForm()" name="choice" value="psp"/>PSP
</form>
</body>
</html>
Help me to solve this problem from pressing back option again & again in browser & view the contents for each page individually either select radio button all,pc, ps2, ps3 or psp normally, without hanging.
Thanks in advance.
Why not simplify
<form id="idForm">
<input type="radio" onClick="window.open('index.php','_self')" name="choice" value="all" checked/>All
<input type="radio" onClick="window.open('pc.php','_self')" name="choice" value="pc"/>PC
<input type="radio" onclick="window.open('ps2.php','_self')" name="choice" value="ps2"/>PS2
<input type="radio" onclick="window.open('ps3.php','_self')" name="choice" value="ps3"/>PS3
<input type="radio" onclick="window.open('psp.php','_self')" name="choice" value="psp"/>PSP
</form>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.