hi guys, below is the script, currently this script allows person to input their age and if they input 0 -> 17 goes to one URL and all other go to another URL, well I need to add 40+ to go to a different URL then those other 2, so 20->39 will go to one URL and then 40+ will go to antoher URL, check the script.. can someone help me real quick with this?
thanksssss
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0051)http://www.umiacs.umd.edu/~gina/lbsc690/select.html -->
<!-- saved from url=(0041)http://glue.umd.edu/~oard/690/select.html -->
<HTML><HEAD><TITLE>Anytown Public Library Search Tool Selector</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<SCRIPT language=JavaScript>
<!--
// This JavaScript Program sends users to a search engine or directory that
// is appropriate to their age.
// Original: 10/6/99 D. W. Oard
// modified: 9/26/2003, Daqing He
// modified: 2/26/2008, Yejun Wu
//jump_to_url is the caller or driver, which calls the other functions, such as is_valid, is_adult, adult_jump, child_jump
function jump_to_url() {
var age = document.age.box.value;
if (is_valid(age)){
if (is_adult(age)){
adult_jump();
}else{
child_jump();
}
}else{
window.alert("Invalid age " + age);
}
}
// Some handy functions that simplify the code
function is_adult(age){
if (age>17){
return true;
}else{
return false;
}
}
//prevent invalid input from "evil" users
function is_valid(age) {
if (age > 0 && age < 120){
return true;
}else{
return false;
}
}
// The main redirection functions
// selection[0] is the content of 1st radio button, selection[1] is the content of 2nd radio button
function adult_jump() {
if (document.tool.selection[0].checked==true){
window.location = "http://altavista.com";
}else{
if (document.tool.selection[1].checked==true){
window.location = "http://dmoz.org";
}else{
window.alert("You must select a search tool!");
}
}
}
function child_jump() {
if (document.tool.selection[0].checked==true){
window.location = "http://www.askforkids.com/";
}else{
if (document.tool.selection[1].checked==true){
window.location = "http://kids.yahoo.com";
}else{
window.alert("Dear kid, please click a round radio button!");
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<H1>Anytown Public Library Search Tool Selector</H1>
<!--every form has a name-->
<FORM name=age><B>Please enter your age</B> <INPUT size=10 value=" " name=box>
</FORM><B>Select a Search Tool:</B>
<!--name of form is "tool", the type of input is a radio button, button name is selection-->
<FORM name=tool>
<INPUT type=radio name=selection> Web Search Engine <BR>
<INPUT type=radio name=selection> Web Directory
</FORM>
<!--associate onclick to function jump_to_url() -->
<FORM name=Search>
<INPUT onclick=jump_to_url() type=button size=10 value=Go! name="go button">
</FORM>
<HR>
</ADDRESS>
<ADDRESS> </ADDRESS>
<SCRIPT language=JavaScript>
<!--
var updated = document.lastModified
document.write("Last modified: "+ updated)
//-->
</SCRIPT>
</BODY></HTML>