p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

asp_forms thread: How can I retrieve selectedindex value using ASP (not javascript)?


Message #1 by "Melissa Mussitsch" <melissa.mussitsch@a...> on Wed, 27 Feb 2002 15:53:17
Hopefully this is an easy one, but how can I retrieve the selectedindex 

from my <select> box using ASP rather than javascript?  I need to use ASP 

because I want to grab the integer and refer to some other elements in my 

array using the same index.



Thanks.

Melissa Mussitsch
Message #2 by Brent Latham <Brent2@w...> on Wed, 27 Feb 2002 15:58:48 -0000
I know :)



strSelect_Value = Request.Form("Select_Name")



Select_Name being the attribute value of the SELECT control on your form ie-



<Select Name="Select_Name"><Option value="1"></Option



Cheers

Brent



-----Original Message-----

From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

Sent: 27 February 2002 15:53

To: ASP Forms

Subject: [asp_forms] How can I retrieve selectedindex value using ASP

(not javascript)?





Hopefully this is an easy one, but how can I retrieve the selectedindex 

from my <select> box using ASP rather than javascript?  I need to use ASP 

because I want to grab the integer and refer to some other elements in my 

array using the same index.



Thanks.

Melissa Mussitsch




Message #3 by Melissa Mussitsch <melissa.mussitsch@a...> on Wed, 27 Feb 2002 13:44:42 -0500
This returns the value - I was hoping for the index instead, similar to how

"selectedindex" works in javascript.



-----Original Message-----

From: Brent Latham [mailto:Brent2@w...]

Sent: Wednesday, February 27, 2002 10:59 AM

To: ASP Forms

Subject: [asp_forms] RE: How can I retrieve selectedindex value using

ASP (not javascript)?





I know :)



strSelect_Value = Request.Form("Select_Name")



Select_Name being the attribute value of the SELECT control on your form ie-



<Select Name="Select_Name"><Option value="1"></Option



Cheers

Brent



-----Original Message-----

From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

Sent: 27 February 2002 15:53

To: ASP Forms

Subject: [asp_forms] How can I retrieve selectedindex value using ASP

(not javascript)?





Hopefully this is an easy one, but how can I retrieve the selectedindex 

from my <select> box using ASP rather than javascript?  I need to use ASP 

because I want to grab the integer and refer to some other elements in my 

array using the same index.



Thanks.

Melissa Mussitsch









Message #4 by Brent Latham <Brent2@w...> on Thu, 28 Feb 2002 09:15:55 -0000
damn - didn't read it properly!



Unfortunately, no you can't get the selectedindex but you can build the

index into the value ie 0#value



then all you need to do is get the value and then split the value so that

you are left with the index number and the real value!



Cheers

Brent



-----Original Message-----

From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

Sent: 27 February 2002 18:45

To: ASP Forms

Subject: [asp_forms] RE: How can I retrieve selectedindex value using

ASP (not javascript)?





This returns the value - I was hoping for the index instead, similar to how

"selectedindex" works in javascript.



-----Original Message-----

From: Brent Latham [mailto:Brent2@w...]

Sent: Wednesday, February 27, 2002 10:59 AM

To: ASP Forms

Subject: [asp_forms] RE: How can I retrieve selectedindex value using

ASP (not javascript)?





I know :)



strSelect_Value = Request.Form("Select_Name")



Select_Name being the attribute value of the SELECT control on your form ie-



<Select Name="Select_Name"><Option value="1"></Option



Cheers

Brent



-----Original Message-----

From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

Sent: 27 February 2002 15:53

To: ASP Forms

Subject: [asp_forms] How can I retrieve selectedindex value using ASP

(not javascript)?





Hopefully this is an easy one, but how can I retrieve the selectedindex 

from my <select> box using ASP rather than javascript?  I need to use ASP 

because I want to grab the integer and refer to some other elements in my 

array using the same index.



Thanks.

Melissa Mussitsch














Message #5 by "Daniel" <daniel@o...> on Thu, 28 Feb 2002 07:13:11 -0500
ahh.. but there is another way. build onto your form a hidden field called

selectnameselectedindex. then in the onsubmit event of the form put some

javascript code in there to grab the selected index of the select box and

place that value in the hidden form. then you can use the forms collection

to get that value. and you dont have to add all them numbers to your select

box where the people see.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151467@a..._forms...

:

: damn - didn't read it properly!

:

: Unfortunately, no you can't get the selectedindex but you can build the

: index into the value ie 0#value

:

: then all you need to do is get the value and then split the value so that

: you are left with the index number and the real value!

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: Sent: 27 February 2002 18:45

: To: ASP Forms

: Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: This returns the value - I was hoping for the index instead, similar to

how

: "selectedindex" works in javascript.

:

: -----Original Message-----

: From: Brent Latham [mailto:Brent2@w...]

: Sent: Wednesday, February 27, 2002 10:59 AM

: To: ASP Forms

: Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: I know :)

:

: strSelect_Value = Request.Form("Select_Name")

:

: Select_Name being the attribute value of the SELECT control on your form

ie-

:

: <Select Name="Select_Name"><Option value="1"></Option

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: Sent: 27 February 2002 15:53

: To: ASP Forms

: Subject: [asp_forms] How can I retrieve selectedindex value using ASP

: (not javascript)?

:

:

: Hopefully this is an easy one, but how can I retrieve the selectedindex

: from my <select> box using ASP rather than javascript?  I need to use ASP

: because I want to grab the integer and refer to some other elements in my

: array using the same index.

:

: Thanks.

: Melissa Mussitsch




:




:




:

:





Message #6 by Brent Latham <Brent2@w...> on Thu, 28 Feb 2002 12:22:13 -0000
Ah but the people dont see the numbers do they!



<Option Value="0#Danny">Danny</Option>



Never-the-less I have used your way whenever I have used a Javascript

function to check the form or submit it!  It saves having to split the

string up etc!



Cheers

Brent



-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: 28 February 2002 12:13

To: ASP Forms

Subject: [asp_forms] Re: How can I retrieve selectedindex value using

ASP (not javascript)?





ahh.. but there is another way. build onto your form a hidden field called

selectnameselectedindex. then in the onsubmit event of the form put some

javascript code in there to grab the selected index of the select box and

place that value in the hidden form. then you can use the forms collection

to get that value. and you dont have to add all them numbers to your select

box where the people see.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151467@a..._forms...

:

: damn - didn't read it properly!

:

: Unfortunately, no you can't get the selectedindex but you can build the

: index into the value ie 0#value

:

: then all you need to do is get the value and then split the value so that

: you are left with the index number and the real value!

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: Sent: 27 February 2002 18:45

: To: ASP Forms

: Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: This returns the value - I was hoping for the index instead, similar to

how

: "selectedindex" works in javascript.

:

: -----Original Message-----

: From: Brent Latham [mailto:Brent2@w...]

: Sent: Wednesday, February 27, 2002 10:59 AM

: To: ASP Forms

: Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: I know :)

:

: strSelect_Value = Request.Form("Select_Name")

:

: Select_Name being the attribute value of the SELECT control on your form

ie-

:

: <Select Name="Select_Name"><Option value="1"></Option

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: Sent: 27 February 2002 15:53

: To: ASP Forms

: Subject: [asp_forms] How can I retrieve selectedindex value using ASP

: (not javascript)?

:

:

: Hopefully this is an easy one, but how can I retrieve the selectedindex

: from my <select> box using ASP rather than javascript?  I need to use ASP

: because I want to grab the integer and refer to some other elements in my

: array using the same index.

:

: Thanks.

: Melissa Mussitsch




:




:




:

:










Message #7 by "Daniel" <daniel@o...> on Thu, 28 Feb 2002 07:24:45 -0500
duh



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151531@a..._forms...

:

: Ah but the people dont see the numbers do they!

:

: <Option Value="0#Danny">Danny</Option>

:

: Never-the-less I have used your way whenever I have used a Javascript

: function to check the form or submit it!  It saves having to split the

: string up etc!

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Daniel [mailto:daniel@o...]

: Sent: 28 February 2002 12:13

: To: ASP Forms

: Subject: [asp_forms] Re: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: ahh.. but there is another way. build onto your form a hidden field called

: selectnameselectedindex. then in the onsubmit event of the form put some

: javascript code in there to grab the selected index of the select box and

: place that value in the hidden form. then you can use the forms collection

: to get that value. and you dont have to add all them numbers to your

select

: box where the people see.

:

: daniel

:

: --

: -----------------------------

: Daniel O'Dorisio

: daniel@o...

: www.odorisio-networks.com

: -----------------------------

: "Brent Latham" <Brent2@w...> wrote in message

: news:151467@a..._forms...

: :

: : damn - didn't read it properly!

: :

: : Unfortunately, no you can't get the selectedindex but you can build the

: : index into the value ie 0#value

: :

: : then all you need to do is get the value and then split the value so

that

: : you are left with the index number and the real value!

: :

: : Cheers

: : Brent

: :

: : -----Original Message-----

: : From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: : Sent: 27 February 2002 18:45

: : To: ASP Forms

: : Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: : ASP (not javascript)?

: :

: :

: : This returns the value - I was hoping for the index instead, similar to

: how

: : "selectedindex" works in javascript.

: :

: : -----Original Message-----

: : From: Brent Latham [mailto:Brent2@w...]

: : Sent: Wednesday, February 27, 2002 10:59 AM

: : To: ASP Forms

: : Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: : ASP (not javascript)?

: :

: :

: : I know :)

: :

: : strSelect_Value = Request.Form("Select_Name")

: :

: : Select_Name being the attribute value of the SELECT control on your form

: ie-

: :

: : <Select Name="Select_Name"><Option value="1"></Option

: :

: : Cheers

: : Brent

: :

: : -----Original Message-----

: : From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: : Sent: 27 February 2002 15:53

: : To: ASP Forms

: : Subject: [asp_forms] How can I retrieve selectedindex value using ASP

: : (not javascript)?

: :

: :

: : Hopefully this is an easy one, but how can I retrieve the selectedindex

: : from my <select> box using ASP rather than javascript?  I need to use

ASP

: : because I want to grab the integer and refer to some other elements in

my

: : array using the same index.

: :

: : Thanks.

: : Melissa Mussitsch




: :




: :




: :

: :

:

:

:




:

:





Message #8 by Melissa Mussitsch <melissa.mussitsch@a...> on Thu, 28 Feb 2002 07:49:30 -0500
Thanks both of you - I think either one will work.



Melissa



-----Original Message-----

From: Brent Latham [mailto:Brent2@w...]

Sent: Thursday, February 28, 2002 7:22 AM

To: ASP Forms

Subject: [asp_forms] Re: How can I retrieve selectedindex value using

ASP (not javascript)?





Ah but the people dont see the numbers do they!



<Option Value="0#Danny">Danny</Option>



Never-the-less I have used your way whenever I have used a Javascript

function to check the form or submit it!  It saves having to split the

string up etc!



Cheers

Brent



-----Original Message-----

From: Daniel [mailto:daniel@o...]

Sent: 28 February 2002 12:13

To: ASP Forms

Subject: [asp_forms] Re: How can I retrieve selectedindex value using

ASP (not javascript)?





ahh.. but there is another way. build onto your form a hidden field called

selectnameselectedindex. then in the onsubmit event of the form put some

javascript code in there to grab the selected index of the select box and

place that value in the hidden form. then you can use the forms collection

to get that value. and you dont have to add all them numbers to your select

box where the people see.



daniel



--

-----------------------------

Daniel O'Dorisio

daniel@o...

www.odorisio-networks.com

-----------------------------

"Brent Latham" <Brent2@w...> wrote in message

news:151467@a..._forms...

:

: damn - didn't read it properly!

:

: Unfortunately, no you can't get the selectedindex but you can build the

: index into the value ie 0#value

:

: then all you need to do is get the value and then split the value so that

: you are left with the index number and the real value!

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: Sent: 27 February 2002 18:45

: To: ASP Forms

: Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: This returns the value - I was hoping for the index instead, similar to

how

: "selectedindex" works in javascript.

:

: -----Original Message-----

: From: Brent Latham [mailto:Brent2@w...]

: Sent: Wednesday, February 27, 2002 10:59 AM

: To: ASP Forms

: Subject: [asp_forms] RE: How can I retrieve selectedindex value using

: ASP (not javascript)?

:

:

: I know :)

:

: strSelect_Value = Request.Form("Select_Name")

:

: Select_Name being the attribute value of the SELECT control on your form

ie-

:

: <Select Name="Select_Name"><Option value="1"></Option

:

: Cheers

: Brent

:

: -----Original Message-----

: From: Melissa Mussitsch [mailto:melissa.mussitsch@a...]

: Sent: 27 February 2002 15:53

: To: ASP Forms

: Subject: [asp_forms] How can I retrieve selectedindex value using ASP

: (not javascript)?

:

:

: Hopefully this is an easy one, but how can I retrieve the selectedindex

: from my <select> box using ASP rather than javascript?  I need to use ASP

: because I want to grab the integer and refer to some other elements in my

: array using the same index.

:

: Thanks.

: Melissa Mussitsch




:




:




:

:
















  Return to Index