|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
radio button choices for page redirect
Three sets of radio buttons control the page redirect for the user.
I don't receive any error messages, but the redirect doesn't happen. Thanks for any help! Jean Fisher Code:
<html>
<head>
<title>More Choices</title>
<script language="JavaScript">
var allOne = new Array ();
allOne[0] = "http://www.maskwoman.biz";
allOne[1] = "http://www.maskwoman.biz/catalog.htm#catalog";
allOne[2] = "http://www.maskwoman.biz/animals.htm";
allOne[3] = "http://www.maskwoman.biz/fantasy.htm#fantasy";
allOne[4] = "http://www.maskwoman.biz/portraits.htm";
var businessOne = new Array ();
businessOne[0] = "http://www.maskwoman.biz";
businessOne[1] = "http://www.maskwoman.biz/catalog.htm#catalog";
var masksOne = new Array ();
masksOne[0] = "http://www.maskwoman.biz/animals.htm";
masksOne[1] = "http://www.maskwoman.biz/fantasy.htm#fantasy";
masksOne[2] = "http://www.maskwoman.biz/portraits.htm";
var allTwo = new Array ();
allTwo[0] = "http://www.maskwoman.biz";
allTwo[1] = "http://www.maskwoman.biz/catalog.htm#catalog";
allTwo[2] = "http://www.maskwoman.biz/animals.htm";
allTwo[3] = "http://www.maskwoman.biz/fantasy.htm#fantasy";
allTwo[4] = "http://www.maskwoman.biz/portraits.htm";
var businessTwo = new Array ();
businessTwo[0] = "http://www.maskwoman.biz";
businessTwo[1] = "http://www.maskwoman.biz/catalog.htm#catalog";
var masksTwo = new Array ();
masksTwo[0] = "http://www.maskwoman.biz/animals.htm";
masksTwo[1] = "http://www.maskwoman.biz/fantasy.htm#fantasy";
masksTwo[2] = "http://www.maskwoman.biz/portraits.htm";
var allThree = new Array ();
allThree[0] = "http://www.maskwoman.biz";
allThree[1] = "http://www.maskwoman.biz/catalog.htm#catalog";
allThree[2] = "http://www.maskwoman.biz/animals.htm";
allThree[3] = "http://www.maskwoman.biz/fantasy.htm#fantasy";
allThree[4] = "http://www.maskwoman.biz/portraits.htm";
var businessThree = new Array ();
businessThree[0] = "http://www.maskwoman.biz";
businessThree[1] = "http://www.maskwoman.biz/catalog.htm#catalog";
var masksThree = new Array ();
masksThree[0] = "http://www.maskwoman.biz/animals.htm";
masksThree[1] = "http://www.maskwoman.biz/fantasy.htm#fantasy";
masksThree[2] = "http://www.maskwoman.biz/portraits.htm";
var levelOne = "(document.adventure.level.one.checked)?true:false";
var levelTwo = "(document.adventure.level.two.checked)?true:false";
var levelThree = "(document.adventure.level.three.checked)?true:fals e";
var shorter = "(document.choose.where.first.checked)?true:false";
var short1 = "(document.choose.where.second.checked)?true:false";
var long1 = "(document.choose.where.third.checked)?true:false";
var nothanks = "(document.list.not.no.checked)?true:false";
var yesplease = "(document.list.not.yes.checked)?true:false";
function whereTo () {
if (levelOne && shorter && nothanks == true) {
window.location = masksOne[Math.floor(Math.random() * masksOne.length)];
}
if (levelOne && short1 && nothanks == true) {
window.location = businessOne[Math.floor(Math.random() * businessOne.length)];
}
if (levelOne && long1 && nothanks == true) {
window.location = allOne[Math.floor(Math.random() * allOne.length)];
}
if (levelTwo && shorter && nothanks == true) {
window.location = masksTwo[Math.floor(Math.random() * masksTwo.length)];
}
if (levelTwo && short1 && nothanks == true) {
window.location = businessTwo[Math.floor(Math.random() * businessTwo.length)];
}
if (levelTwo && long1 && nothanks == true) {
window.location = allTwo[Math.floor(Math.random() * allTwo.length)];
}
if (levelThree && shorter && nothanks == true) {
window.location = masksThree[Math.floor(Math.random() * masksThree.length)];
}
if (levelThree && short1 && nothanks == true) {
window.location = businessThree[Math.floor(Math.random() * businessThree.length)];
}
if (levelThree && long1 && nothanks == true) {
window.location = allThree[Math.floor(Math.random() * allThree.length)];
}
if (levelOne && shorter && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelOne && short1 && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelOne && long1 && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelTwo && shorter && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelTwo && short1 && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelTwo && long1 && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelThree && shorter && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelThree && short1 && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
if (levelThree && long1 && yesplease == true) {
window.location = "http://www.maskwoman.biz";
}
}
</script>
</head>
<body>
<p><h3>Choose a level</h3></p>
<form name="adventure">
<input type="radio" name="level" value="one">First List<br>
<input Type="radio" name="level" value="two">Second List<br>
<input type="radio" name="level" value="three">Third List<br>
</form>
<h3>What do you want to see?</h3>
<form>
<form name ="choose">
<input type="radio" name="where" VALUE="first"> Conduct Business<br>
<input type="radio" name="who" VALUE="second"> Look at Masks<br>
<input type="radio" name="who" value="third"> All
</form>
<h3>Print a list?</h3>
<form>
<form name = "list">
<input type="radio" name="not" VALUE="No"> No<br>
<input type="radio" name="not" VALUE="Yes"> Yes<br>
<input type="button" onclick=" return whereTo()" value="Where?">
</form>
</body>
</html>
Last edited by MadCowDzz : February 13th, 2004 at 10:27 PM. Reason: added [code] tags |
|
#2
|
||||
|
||||
|
i tried taking a look at your code, its just really confusing, try to replace all of your if thens with solid if thens as in...
instead of... if (this && this2 && this3 == this4) {} if ((this==this4) && (this2==this4) && (this3==this4)) {} otherwize i wouldnt know what to do... colton22 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > radio button choices for page redirect |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|