Re: Posting a selected option (drop down list)
Serge Myrand wrote:[color=blue]
> 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[/color]
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. |