Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:20 PM
Serge Myrand
Guest
 
Posts: n/a
Default Posting a selected option (drop down list)

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

  #2  
Old July 19th, 2005, 02:20 PM
Bob Barrows [MVP]
Guest
 
Posts: n/a
Default 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.


  #3  
Old July 19th, 2005, 02:21 PM
Serge Myrand
Guest
 
Posts: n/a
Default Re: Posting a selected option (drop down list)

Thank's

serge


"Bob Barrows [MVP]" wrote:
[color=blue]
> Serge Myrand wrote:[color=green]
> > 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.[/color]

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles