JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old February 13th, 2004, 03:18 PM
prizsm prizsm is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 1 prizsm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old June 30th, 2006, 11:26 PM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 471 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 9 m 44 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > radio button choices for page redirect


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway