By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,285 Members | 2,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,285 IT Pros & Developers. It's quick & easy.

Posting a selected option (drop down list)

P: n/a
Hi,

I cannot get the selected option to be POSTed (it does not appear in the
QueryString when using GET neither)

I construct the drop down list from an array, I select an element in the
list, I POST using a submit button. When I use Request.Form("NAME") it's
always empty. Is the selected item is Posted? How to retreive it?
Response.Write "<SELECT NAME>"
for i = LBound(aRessource, 1) to UBound(aRessource, 1)
Response.Write "<OPTION VALUE=" & i & ">"
Response.Write aRessource(i, 0)
next
Response.Write "<OPTION SELECTED>"
Response.Write "</SELECT>"
thank you for your time
serge

Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Serge Myrand wrote:
Hi,

I cannot get the selected option to be POSTed (it does not appear in
the QueryString when using GET neither)

I construct the drop down list from an array, I select an element in
the list, I POST using a submit button. When I use
Request.Form("NAME") it's always empty. Is the selected item is
Posted? How to retreive it?
Response.Write "<SELECT NAME>"
for i = LBound(aRessource, 1) to UBound(aRessource, 1)
Response.Write "<OPTION VALUE=" & i & ">"
Response.Write aRessource(i, 0)
next
Response.Write "<OPTION SELECTED>"
Response.Write "</SELECT>"
thank you for your time
serge

1. Do not use reserved words for object or variable names. "NAME" is a word
that should definitely be avoided: it is used everywhere!
2. You did not assign a name to the SELECT's name attribute. It should be
like this:

Response.Write "<SELECT name=""lstRessource"">"
In the other page, you would do this:

Request.Form("lstRessource")

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jul 19 '05 #2

P: n/a
Thank's

serge
"Bob Barrows [MVP]" wrote:
Serge Myrand wrote:
Hi,

I cannot get the selected option to be POSTed (it does not appear in
the QueryString when using GET neither)

I construct the drop down list from an array, I select an element in
the list, I POST using a submit button. When I use
Request.Form("NAME") it's always empty. Is the selected item is
Posted? How to retreive it?
Response.Write "<SELECT NAME>"
for i = LBound(aRessource, 1) to UBound(aRessource, 1)
Response.Write "<OPTION VALUE=" & i & ">"
Response.Write aRessource(i, 0)
next
Response.Write "<OPTION SELECTED>"
Response.Write "</SELECT>"
thank you for your time
serge


1. Do not use reserved words for object or variable names. "NAME" is a word
that should definitely be avoided: it is used everywhere!
2. You did not assign a name to the SELECT's name attribute. It should be
like this:

Response.Write "<SELECT name=""lstRessource"">"

In the other page, you would do this:

Request.Form("lstRessource")

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.