 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
Yahya2004
Joined: 03 Nov 2004 Posts: 3
|
Posted: Wed Nov 03, 2004 7:03 pm two dropdown menus :roll: |
|
|
|
hi all,
i am new in HTML and building a simple html page.
i have a problem ...
i made two dropdown menus but how i connect them together..
the picture is:
the first dropdown active ant the second not active,
then when i choose the first option in the first dropdown menu the next dropdown menu activate and it loads the list of the first option in the first dropdown menu.
i would like to do this... but how??  |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8316 Location: Castle Pines North, CO USA
|
Posted: Thu Nov 04, 2004 5:50 am |
|
|
|
You can use JavaScript. In the <HEAD>:
| Code: |
<script language="JAVASCRIPT">
var browser_type=navigator.appName
var employerArray = new Array("General Information", "Enrollment Services", "Flexible Benefits", "Commuter Choice Program", "COBRA Administration", "Invoice Reconciliation", "Voluntary Benefits", "Payroll Deduction Benefits", "MasterCash ATM Card" , "User Name / Password Problems")
var employeeArray = new Array("General Information", "Flex Plan", "Commuter Choice Plan","Enrollment Services", "COBRA Administration", "Pending Notifications", "Specific Expenses", "MasterCash ATM Card", "User Name / Password Problems")
var brokerArray = new Array("General Information", "Flex Plan", "Commuter Choice Plan", "Section 125 Plan" , "Commuter / Transit" , "COBRA Administration", "MasterCash ATM Card", "Voluntary Benefits", "Other")
var otherArray = new Array("Other")
function updateList(theForm, catName, subjListLength){
for (var i=subjListLength + 1 ; i > 0 ; i-- )
{
theForm.Subject.options[i] = null
}
if( catName == "None"){
var option0 = new Option("- Please Choose a Category Above -", "None")
}
else{
eval('var option0 = new Option("- Please Choose -", "None")')
}
NSL=0
if (catName != "None") {
eval("var NewSource = " + catName +"Array")
NSL = NewSource.length
for(var L = 0; L < NSL + 1; L++) {
eval("var option" + [L + 1] + " = new Option(" + '"' + NewSource[L] + '", "' + NewSource[L] + '")')
}
}
for (var i=0; i < NSL + 1; i++) {
eval("theForm.Subject.options[i]=option" + i)
if (i==0) {
theForm.Subject.options[i].selected=true
}
}
if (browser_type=="Netscape")
{ history.go(0) }
}
</script> |
And then in the <BODY>
| Code: |
<select name="Category" size="1" onChange="updateList(this.form, this.options[selectedIndex].value, this.form.Subject.length)">
<option value="None" Selected >- Please Choose - </option>
<option value="employer" >Employer </option>
<option value="employee" >Employee </option>
<option value="broker" >Broker </option>
<option value="other" >Other </option>
</select>
<select name="Subject" id="Subject">
<option value="None" SELECTED>- Please Choose a Category Above - </option>
</select> |
|
|
Yahya2004
Joined: 03 Nov 2004 Posts: 3
|
Posted: Thu Nov 04, 2004 9:25 am |
|
|
|
hi Corey Bryant,
thanks for that solution i am already trying it
many many thanks to u  |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|