Passing a selected value to a form

T

TNGgroup

Hi,

Question, I have a simple form and want to submit a selected value of a
combo box.
so my combo box is named "selectname" and my form has action="file.asp?"
what do I have to put after the question mark ?

Thx in advance

Wim
 
B

Bob Barrows [MVP]

TNGgroup said:
Hi,

Question, I have a simple form and want to submit a selected value of
a combo box.
so my combo box is named "selectname" and my form has
action="file.asp?" what do I have to put after the question mark ?

Thx in advance

Wim
Nothing. Get rid of the "?". Depending on the method attribute of your form
element, your select element's value (there is no such thing as a combobox
in html) will be passed without your doing a thing. If you use "GET", the
form values will be automatically appended to the url's querystring. If you
use "POST", the values will be passed in the Form collection. Go to
msdn.microsoft.com/library and look up Request object, Form element, and
Method attribute.

Bob Barrows
 
T

TNGgroup

Hi,

When I post my form, (change the form attribute into get) and in the action
specify the file which opens, I receive all my records, but what I need is
the only the record which I selected in the list box

I tried to look to the MS Site, but did not help a lot.

TNG
 
B

Bob Barrows [MVP]

How can we help? You're not showing us what you are doing. Create a small
page (or two) that reproduces your problem and post that.

Bob Barrows
 
A

Alex Goodey

When you submit a form, all elements in the form are passed to the "action"
page.

In your action page simply use.

Request.QueryString("selectname")
 
T

TNGgroup

Yes ! that was what I'm looking for Great

Thx


Alex Goodey said:
When you submit a form, all elements in the form are passed to the "action"
page.

In your action page simply use.

Request.QueryString("selectname")
 
T

TNGgroup

Solution works as said before, but a small additional question, how can I
solve 2 forms pointing to the same page ?
 
A

Alex Goodey

You will have to provide some more information about what you are trying to
do.

Are both forms on the same page?

only one form can be submitted at any one time.
 
T

TNGgroup

Ok, indeed both forms are on the same page, so like you said if only one
form can be submitted. I have to change my structure.

Thx anyway
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top