/    Sign up×
Community /Pin to ProfileBookmark

change dropdown menu

The following is to let you select one from drop down menu and another drop down menu will be appear on the page. I want to change the code so when I select every single value in the dropdown menu, the page will be the same except when I select the last single value, the page will have a textbox appear on the page. how can I do that? please help me. thank you
<script type=”text/javascript” language=”JavaScript”>
<!–
function setOptions(area,dropdown)
{
var status=area[area.selectedIndex].value;
dropdown.options.length = 1;
if (status == “”) {
dropdown.options[0] = new Option(‘Please select one of the options above first’,’ ‘);
}

else if (status == “BIZ”) {
dropdown.options[0] = new Option(‘- Select a Program -‘,”);
dropdown.options[1] = new Option(‘Bachelor of Science in Business’,’Biz,BSB’);
dropdown.options[2] = new Option(‘Bachelor of Science in Management’,’Biz,BSM’);
dropdown.options[3] = new Option(‘2+2 Bachelor of Science in Business’,’Biz,BSB22′);
dropdown.options[4] = new Option(‘2+2 Bachelor of Science in Management’,’Biz,BSM22′);
dropdown.options[5] = new Option(‘Associate of Applied Science in Business Administration/Accounting’,’Biz,AASBAA’);
dropdown.options[6] = new Option(‘Associate of Applied Science in Business Administration/Management’,’Biz,AASBAM’);
}

else if (status == “IT”) {
dropdown.options[0] = new Option(‘- Select a Program -‘,”);
dropdown.options[1] = new Option(‘Bachelor of Science in Information Technology’,’IT,BSIT’);
dropdown.options[2] = new Option(‘2+2 Bachelor of Science in Information Technology’,’IT,22BSIT’);
dropdown.options[3] = new Option(‘Associate of Applied Science in Computer Information Systems’,’IT,AASCIS’);
dropdown.options[4] = new Option(‘Information Technology Pathway Certificate’,’IT,ITPATH’);
dropdown.options[5] = new Option(‘Internet and Website Development Certificate’,’IT,INETWEBDEV’);
dropdown.options[6] = new Option(‘Intro to Computer Programming Language Certificate’,’IT,INTROCPL’);

}

else if (status == “CJ”) {
dropdown.options[0] = new Option(‘- Select a Program -‘,”);
dropdown.options[1] = new Option(‘Bachelor of Science in Criminal Justice’,’CJ,BSCJ’);
dropdown.options[2] = new Option(‘2+2 Bachelor of Science in Criminal Justice’,’CJ,22BSCJ’);
dropdown.options[3] = new Option(‘Associate of Applied Science in Criminal Justice’,’CJ,AASCJ’);
dropdown.options[4] = new Option(‘Crime Scene Technician Certificate’,’CJ,CSTC’);
dropdown.options[5] = new Option(“Terrorism/National Security Certificate”,’CJ,TNSC’);

}

else if (status == “PL”) {
dropdown.options[0] = new Option(‘- Select a Program -‘,”);
dropdown.options[1] = new Option(‘Bachelor of Science in Paralegal Studies’,’PL,BSPS’);
dropdown.options[2] = new Option(‘2+2 Bachelor of Science in Paralegal Studies’,’PL,22BSPS’);
dropdown.options[3] = new Option(‘Associate of Applied Science in Paralegal Studies’,’PL,AASPLS’);
dropdown.options[4] = new Option(‘Pathway to Paralegal Certificate’,’PL,PPLC’);
}
else if (status == “AS”) {
dropdown.options[0] = new Option(‘- Select a Program -‘,”);
dropdown.options[1] = new Option(‘SCHOOL OF ARTS & SCIENCES – Associate of Applied Science in Interdisciplinary Studies’,’AS,ASIS’);
}
}
//–>

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@handong888authorJan 25.2005 — <script type="text/javascript" language="JavaScript">

<!--

function setOptions(area,dropdown)

{

var status=area[area.selectedIndex].value;


if (status == "Visa") {

}

else if (status == "Mastercard") {

}

else if (status == "American Express") {


}

else if (status == "Discover Card") {


}

else if (status == "Macy") {


}

else if (status == "Kohl") {


}

else if (status == "Sears") {


}

else if (status == "JC Penney") {


}

else if (status == "Other") {


}

}

//-->

</script>

what I want is that If status == "Other", I want to have a new textbox show it on the page, if status == the rest of, i want to the page to be the same. how can I make this happen it with the above code. please help and thank you very much
×

Success!

Help @handong888 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...