|
 |
asp_cdo thread: Syntax for accessing form dropdown box
Message #1 by "larry Rosenzweig" <rosenzl@o...> on Thu, 20 Feb 2003 16:21:54
|
|
I have a form that open a dropdown box which displays items such as
appetizers, entrees, beverages, etc. When you select an option, it opens a
second dropdown box with the specific appetizers, entrees, etc. I am tring
to access these option entries in my .asp page which uses cdonts.
Here is what the first dropdown box looks like:
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option> etc????.
This is what the cdonts page code looks like with request.form.....
emailfrom = Request.Form("emailaddress") - emailaddress is the name of
the field in the form and it works fine.
Hfirstchoice = request.form(?firstchoice?) - this gives me the number
2, but not the ?side dishes? associated with it.
How do I pickup the side "dishes/misc" in my asp page?
Thanks,
Larry
Message #2 by "Fernando Soto" <fsoto@f...> on Thu, 20 Feb 2003 11:13:54 -0800
|
|
It gives you the number 2, because it is the value you have asociated to
"Side dishes"....
"Side dishes" only is for displaying, if you want to get "side dishes" in
Hfirstchoice = request.form(?firstchoice?)
you have to change the number 2 by "side dishes", by example:
<option value="Side Dishes/Misc.">Side Dishes/Misc.</option>
right?
i hope it helps.....
elFeR........
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Thursday, February 20, 2003 4:22 PM
To: ASP CDO
Subject: [asp_cdo] Syntax for accessing form dropdown box
I have a form that open a dropdown box which displays items such as
appetizers, entrees, beverages, etc. When you select an option, it opens a
second dropdown box with the specific appetizers, entrees, etc. I am tring
to access these option entries in my .asp page which uses cdonts.
Here is what the first dropdown box looks like:
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option> etc????.
This is what the cdonts page code looks like with request.form.....
emailfrom = Request.Form("emailaddress") - emailaddress is the name of
the field in the form and it works fine.
Hfirstchoice = request.form(?firstchoice?) - this gives me the number
2, but not the ?side dishes? associated with it.
How do I pickup the side "dishes/misc" in my asp page?
Thanks,
Larry
Message #3 by "larry Rosenzweig" <rosenzl@o...> on Fri, 21 Feb 2003 20:33:05
|
|
elfer, What I forgot to add to my original post is that the first dropdown
box selection causes a second dropdown box to open. Now I will give more
details. The function uses the numbers. see below.
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--)
controlToPopulate.options[q]=null;
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
_________________________________________________________________________
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option>
<option value=4>Eggs & Omelettes</option>
<option value=5>Hot Open Sand.</option>
<option value=6>Lox on Bagel</option>
<option value=7>Beef/Turkey Burgers</option>
<option value=8>Overstuffed Sand.</option>
<option value=9>Combination Sand.</option>
<option value=10>Deli Platters</option>
<option value=11>Entrees</option>
<option value=12>Cold Salad Platters</option>
<option value=13>Kids Menu</option>
<option value=14>Desserts</option>
<option value=15>Beverages</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice>
</Select>
____________________________________________________________________
Below are some options made available upon selecting side
dishes/misc.
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = 2;
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = 2;
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = 2;
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = 2;
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = 2;
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = 2;
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = 2;
arrItems1[313] = "Potato Knish 9.99";
arrItemsGrp1[313] = 2;
arrItems1[314] = "Kasha Knish 9.99";
arrItemsGrp1[314] = 2;
Thanks for the help. I have been trying to get this to work for 3 days!
If you go to www.faxfoodorder.com/faxform.htm you will see how it works.
> It gives you the number 2, because it is the value you have asociated to
"Side dishes"....
"Side dishes" only is for displaying, if you want to get "side dishes" in
Hfirstchoice = request.form(?firstchoice?)
you have to change the number 2 by "side dishes", by example:
<option value="Side Dishes/Misc.">Side Dishes/Misc.</option>
right?
i hope it helps.....
elFeR........
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Thursday, February 20, 2003 4:22 PM
To: ASP CDO
Subject: [asp_cdo] Syntax for accessing form dropdown box
I have a form that open a dropdown box which displays items such as
appetizers, entrees, beverages, etc. When you select an option, it opens a
second dropdown box with the specific appetizers, entrees, etc. I am tring
to access these option entries in my .asp page which uses cdonts.
Here is what the first dropdown box looks like:
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option> etc????.
This is what the cdonts page code looks like with request.form.....
emailfrom = Request.Form("emailaddress") - emailaddress is the name of
the field in the form and it works fine.
Hfirstchoice = request.form(?firstchoice?) - this gives me the number
2, but not the ?side dishes? associated with it.
How do I pickup the side "dishes/misc" in my asp page?
Thanks,
Larry
Message #4 by "Fernando Soto" <fsoto@f...> on Fri, 21 Feb 2003 14:07:07 -0800
|
|
ok,
i see in the code that you are filling the arrays with the information of
the items, right?....
and you have the number 2 associated to the Side Dishes/Misc. option....
First probable solution:
then, you need to change that number in the array, something like the
following:
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = "Side Dishes/Misc";
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = "Side Dishes/Misc";
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = "Side Dishes/Misc";
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = "Side Dishes/Misc";
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = "Side Dishes/Misc";
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = "Side Dishes/Misc";
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = "Side Dishes/Misc";
and so on for all the options that have the number 2......and the same for
all the numbers 1, 3, 4, etc.... you have in the array....
the problem with this is that if you are creating this array manually, when
some value change, you will need to make that changes.... ok?.....
Or you can try this second one......
In the faxform.asp, you can do something like this:
Select Case request.form(?firstchoice?)
Case "1"
strFirstChoice = "Appetizers"
Case "2"
strFirstChoice = "Side Dishes/Misc"
Case "3"
strFirstChoice = "Homemade Soups"
Case "4"
strFirstChoice = "Eggs & Omelettes"
Case "5"
strFirstChoice = "Hot Open Sand."
Case "option n"
strFirstChoice = "Something"
End Select
Then, you have to do this:
emailfrom = Request.Form("emailaddress") - emailaddress is the name of the
field in the form and it works fine.
Hfirstchoice = strFirstChoice - strFirstChoice contains "Side
Dishes/Misc" not the Number 2......
I think this second one is a better solution than first......
I hope it helps....
eLFeR.......
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Friday, February 21, 2003 8:33 PM
To: ASP CDO
Subject: [asp_cdo] RE: Syntax for accessing form dropdown box
elfer, What I forgot to add to my original post is that the first dropdown
box selection causes a second dropdown box to open. Now I will give more
details. The function uses the numbers. see below.
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--)
controlToPopulate.options[q]=null;
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
_________________________________________________________________________
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option>
<option value=4>Eggs & Omelettes</option>
<option value=5>Hot Open Sand.</option>
<option value=6>Lox on Bagel</option>
<option value=7>Beef/Turkey Burgers</option>
<option value=8>Overstuffed Sand.</option>
<option value=9>Combination Sand.</option>
<option value=10>Deli Platters</option>
<option value=11>Entrees</option>
<option value=12>Cold Salad Platters</option>
<option value=13>Kids Menu</option>
<option value=14>Desserts</option>
<option value=15>Beverages</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice>
</Select>
____________________________________________________________________
Below are some options made available upon selecting side
dishes/misc.
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = 2;
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = 2;
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = 2;
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = 2;
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = 2;
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = 2;
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = 2;
arrItems1[313] = "Potato Knish 9.99";
arrItemsGrp1[313] = 2;
arrItems1[314] = "Kasha Knish 9.99";
arrItemsGrp1[314] = 2;
Thanks for the help. I have been trying to get this to work for 3 days!
If you go to www.faxfoodorder.com/faxform.htm you will see how it works.
> It gives you the number 2, because it is the value you have asociated to
"Side dishes"....
"Side dishes" only is for displaying, if you want to get "side dishes" in
Hfirstchoice = request.form(?firstchoice?)
you have to change the number 2 by "side dishes", by example:
<option value="Side Dishes/Misc.">Side Dishes/Misc.</option>
right?
i hope it helps.....
elFeR........
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Thursday, February 20, 2003 4:22 PM
To: ASP CDO
Subject: [asp_cdo] Syntax for accessing form dropdown box
I have a form that open a dropdown box which displays items such as
appetizers, entrees, beverages, etc. When you select an option, it opens a
second dropdown box with the specific appetizers, entrees, etc. I am tring
to access these option entries in my .asp page which uses cdonts.
Here is what the first dropdown box looks like:
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option> etc????.
This is what the cdonts page code looks like with request.form.....
emailfrom = Request.Form("emailaddress") - emailaddress is the name of
the field in the form and it works fine.
Hfirstchoice = request.form(?firstchoice?) - this gives me the number
2, but not the ?side dishes? associated with it.
How do I pickup the side "dishes/misc" in my asp page?
Thanks,
Larry
Message #5 by "larry Rosenzweig" <rosenzl@o...> on Fri, 21 Feb 2003 21:43:07
|
|
If I chose your first option, what would have to change in the Function
(selectchange), which currently is looking for numbers?
Thanks
> ok,
i see in the code that you are filling the arrays with the information of
the items, right?....
and you have the number 2 associated to the Side Dishes/Misc. option....
First probable solution:
then, you need to change that number in the array, something like the
following:
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = "Side Dishes/Misc";
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = "Side Dishes/Misc";
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = "Side Dishes/Misc";
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = "Side Dishes/Misc";
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = "Side Dishes/Misc";
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = "Side Dishes/Misc";
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = "Side Dishes/Misc";
and so on for all the options that have the number 2......and the same for
all the numbers 1, 3, 4, etc.... you have in the array....
the problem with this is that if you are creating this array manually, when
some value change, you will need to make that changes.... ok?.....
Or you can try this second one......
In the faxform.asp, you can do something like this:
Select Case request.form(?firstchoice?)
Case "1"
strFirstChoice = "Appetizers"
Case "2"
strFirstChoice = "Side Dishes/Misc"
Case "3"
strFirstChoice = "Homemade Soups"
Case "4"
strFirstChoice = "Eggs & Omelettes"
Case "5"
strFirstChoice = "Hot Open Sand."
Case "option n"
strFirstChoice = "Something"
End Select
Then, you have to do this:
emailfrom = Request.Form("emailaddress") - emailaddress is the name of the
field in the form and it works fine.
Hfirstchoice = strFirstChoice - strFirstChoice contains "Side
Dishes/Misc" not the Number 2......
I think this second one is a better solution than first......
I hope it helps....
eLFeR.......
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Friday, February 21, 2003 8:33 PM
To: ASP CDO
Subject: [asp_cdo] RE: Syntax for accessing form dropdown box
elfer, What I forgot to add to my original post is that the first dropdown
box selection causes a second dropdown box to open. Now I will give more
details. The function uses the numbers. see below.
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--)
controlToPopulate.options[q]=null;
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
_________________________________________________________________________
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option>
<option value=4>Eggs & Omelettes</option>
<option value=5>Hot Open Sand.</option>
<option value=6>Lox on Bagel</option>
<option value=7>Beef/Turkey Burgers</option>
<option value=8>Overstuffed Sand.</option>
<option value=9>Combination Sand.</option>
<option value=10>Deli Platters</option>
<option value=11>Entrees</option>
<option value=12>Cold Salad Platters</option>
<option value=13>Kids Menu</option>
<option value=14>Desserts</option>
<option value=15>Beverages</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice>
</Select>
____________________________________________________________________
Below are some options made available upon selecting side
dishes/misc.
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = 2;
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = 2;
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = 2;
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = 2;
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = 2;
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = 2;
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = 2;
arrItems1[313] = "Potato Knish 9.99";
arrItemsGrp1[313] = 2;
arrItems1[314] = "Kasha Knish 9.99";
arrItemsGrp1[314] = 2;
Thanks for the help. I have been trying to get this to work for 3 days!
If you go to www.faxfoodorder.com/faxform.htm you will see how it works.
> It gives you the number 2, because it is the value you have asociated to
"Side dishes"....
"Side dishes" only is for displaying, if you want to get "side dishes" in
Hfirstchoice = request.form(?firstchoice?)
you have to change the number 2 by "side dishes", by example:
<option value="Side Dishes/Misc.">Side Dishes/Misc.</option>
right?
i hope it helps.....
elFeR........
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Thursday, February 20, 2003 4:22 PM
To: ASP CDO
Subject: [asp_cdo] Syntax for accessing form dropdown box
I have a form that open a dropdown box which displays items such as
appetizers, entrees, beverages, etc. When you select an option, it opens a
second dropdown box with the specific appetizers, entrees, etc. I am tring
to access these option entries in my .asp page which uses cdonts.
Here is what the first dropdown box looks like:
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option> etc????.
This is what the cdonts page code looks like with request.form.....
emailfrom = Request.Form("emailaddress") - emailaddress is the name of
the field in the form and it works fine.
Hfirstchoice = request.form(?firstchoice?) - this gives me the number
2, but not the ?side dishes? associated with it.
How do I pickup the side "dishes/misc" in my asp page?
Thanks,
Larry
Message #6 by "Fernando Soto" <fsoto@f...> on Fri, 21 Feb 2003 14:42:13 -0800
|
|
iīm sorry man.....
but i donīt know how to do this because i really don't know how this
function works.....
that's why i recommend you the second solution.....
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Friday, February 21, 2003 9:43 PM
To: ASP CDO
Subject: [asp_cdo] RE: Syntax for accessing form dropdown box
If I chose your first option, what would have to change in the Function
(selectchange), which currently is looking for numbers?
Thanks
> ok,
i see in the code that you are filling the arrays with the information of
the items, right?....
and you have the number 2 associated to the Side Dishes/Misc. option....
First probable solution:
then, you need to change that number in the array, something like the
following:
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = "Side Dishes/Misc";
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = "Side Dishes/Misc";
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = "Side Dishes/Misc";
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = "Side Dishes/Misc";
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = "Side Dishes/Misc";
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = "Side Dishes/Misc";
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = "Side Dishes/Misc";
and so on for all the options that have the number 2......and the same for
all the numbers 1, 3, 4, etc.... you have in the array....
the problem with this is that if you are creating this array manually, when
some value change, you will need to make that changes.... ok?.....
Or you can try this second one......
In the faxform.asp, you can do something like this:
Select Case request.form(?firstchoice?)
Case "1"
strFirstChoice = "Appetizers"
Case "2"
strFirstChoice = "Side Dishes/Misc"
Case "3"
strFirstChoice = "Homemade Soups"
Case "4"
strFirstChoice = "Eggs & Omelettes"
Case "5"
strFirstChoice = "Hot Open Sand."
Case "option n"
strFirstChoice = "Something"
End Select
Then, you have to do this:
emailfrom = Request.Form("emailaddress") - emailaddress is the name of the
field in the form and it works fine.
Hfirstchoice = strFirstChoice - strFirstChoice contains "Side
Dishes/Misc" not the Number 2......
I think this second one is a better solution than first......
I hope it helps....
eLFeR.......
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Friday, February 21, 2003 8:33 PM
To: ASP CDO
Subject: [asp_cdo] RE: Syntax for accessing form dropdown box
elfer, What I forgot to add to my original post is that the first dropdown
box selection causes a second dropdown box to open. Now I will give more
details. The function uses the numbers. see below.
function selectChange(control, controlToPopulate, ItemArray, GroupArray)
{
var myEle ;
var x ;
// Empty the second drop down box of any choices
for (var q=controlToPopulate.options.length;q>=0;q--)
controlToPopulate.options[q]=null;
// ADD Default Choice - in case there are no values
myEle = document.createElement("option") ;
myEle.value = 0 ;
myEle.text = "[SELECT]" ;
controlToPopulate.add(myEle) ;
// Now loop through the array of individual items
// Any containing the same child id are added to
// the second dropdown box
for ( x = 0 ; x < ItemArray.length ; x++ )
{
if ( GroupArray[x] == control.value )
{
myEle = document.createElement("option") ;
myEle.value = x ;
myEle.text = ItemArray[x] ;
controlToPopulate.add(myEle) ;
}
}
}
// End -->
</script>
_________________________________________________________________________
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option>
<option value=4>Eggs & Omelettes</option>
<option value=5>Hot Open Sand.</option>
<option value=6>Lox on Bagel</option>
<option value=7>Beef/Turkey Burgers</option>
<option value=8>Overstuffed Sand.</option>
<option value=9>Combination Sand.</option>
<option value=10>Deli Platters</option>
<option value=11>Entrees</option>
<option value=12>Cold Salad Platters</option>
<option value=13>Kids Menu</option>
<option value=14>Desserts</option>
<option value=15>Beverages</option>
</SELECT>
</TD><TD>
<SELECT id=secondChoice name=secondChoice>
</Select>
____________________________________________________________________
Below are some options made available upon selecting side
dishes/misc.
arrItems1[306] = "French Fries (fresh cut) 9.99";
arrItemsGrp1[306] = 2;
arrItems1[307] = "Onion Rings (home made) 9.99";
arrItemsGrp1[307] = 2;
arrItems1[308] = "Mashed Potatoes 9.99";
arrItemsGrp1[308] = 2;
arrItems1[309] = "Baked Potato 9.99";
arrItemsGrp1[309] = 2;
arrItems1[310] = "Potato Salad 9.99";
arrItemsGrp1[310] = 2;
arrItems1[311] = "Cole Slaw 9.99";
arrItemsGrp1[311] = 2;
arrItems1[312] = "Macaroni Salad 9.99";
arrItemsGrp1[312] = 2;
arrItems1[313] = "Potato Knish 9.99";
arrItemsGrp1[313] = 2;
arrItems1[314] = "Kasha Knish 9.99";
arrItemsGrp1[314] = 2;
Thanks for the help. I have been trying to get this to work for 3 days!
If you go to www.faxfoodorder.com/faxform.htm you will see how it works.
> It gives you the number 2, because it is the value you have asociated to
"Side dishes"....
"Side dishes" only is for displaying, if you want to get "side dishes" in
Hfirstchoice = request.form(?firstchoice?)
you have to change the number 2 by "side dishes", by example:
<option value="Side Dishes/Misc.">Side Dishes/Misc.</option>
right?
i hope it helps.....
elFeR........
-----Original Message-----
From: larry Rosenzweig [mailto:rosenzl@o...]
Sent: Thursday, February 20, 2003 4:22 PM
To: ASP CDO
Subject: [asp_cdo] Syntax for accessing form dropdown box
I have a form that open a dropdown box which displays items such as
appetizers, entrees, beverages, etc. When you select an option, it opens a
second dropdown box with the specific appetizers, entrees, etc. I am tring
to access these option entries in my .asp page which uses cdonts.
Here is what the first dropdown box looks like:
<SELECT id=firstChoice name=firstChoice onchange="selectChange(this,
secondChoice, arrItems1, arrItemsGrp1);">
<option value=0 SELECTED>[SELECT]</option>
<option value=1>Appetizers</option>
<option value=2>Side Dishes/Misc.</option>
<option value=3>Homemade Soups</option> etc????.
This is what the cdonts page code looks like with request.form.....
emailfrom = Request.Form("emailaddress") - emailaddress is the name of
the field in the form and it works fine.
Hfirstchoice = request.form(?firstchoice?) - this gives me the number
2, but not the ?side dishes? associated with it.
How do I pickup the side "dishes/misc" in my asp page?
Thanks,
Larry
|
|
 |