473,385 Members | 1,782 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Passing a selected value to a form

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
Jul 22 '05 #1
8 1703
TNGgroup wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #2
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
TNGgroup wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Jul 22 '05 #3
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

TNGgroup wrote:
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
TNGgroup wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so
I don't check it very often. If you must reply off-line, then remove
the "NO SPAM"


--
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 22 '05 #4
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")

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41**********************@news.skynet.be...
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
TNGgroup wrote:
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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jul 22 '05 #5
Yes ! that was what I'm looking for Great

Thx
"Alex Goodey" <ag*****@hsfinancial.co.uk> wrote in message
news:30*************@uni-berlin.de...
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")

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41**********************@news.skynet.be...
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
TNGgroup wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Jul 22 '05 #6
Solution works as said before, but a small additional question, how can I
solve 2 forms pointing to the same page ?

"Alex Goodey" <ag*****@hsfinancial.co.uk> wrote in message
news:30*************@uni-berlin.de...
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")

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41**********************@news.skynet.be...
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
TNGgroup wrote:
> 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
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"



Jul 22 '05 #7
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.

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41***********************@news.skynet.be...
Solution works as said before, but a small additional question, how can I
solve 2 forms pointing to the same page ?

"Alex Goodey" <ag*****@hsfinancial.co.uk> wrote in message
news:30*************@uni-berlin.de...
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")

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41**********************@news.skynet.be...
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

"Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
news:Oq**************@TK2MSFTNGP14.phx.gbl...
> TNGgroup wrote:
> > 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
> --
> Microsoft MVP - ASP/ASP.NET
> Please reply to the newsgroup. This email account is my spam trap so

I > don't check it very often. If you must reply off-line, then remove the > "NO SPAM"
>
>



Jul 22 '05 #8
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

"Alex Goodey" <ag*****@hsfinancial.co.uk> wrote in message
news:30*************@uni-berlin.de...
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.

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41***********************@news.skynet.be...
Solution works as said before, but a small additional question, how can I
solve 2 forms pointing to the same page ?

"Alex Goodey" <ag*****@hsfinancial.co.uk> wrote in message
news:30*************@uni-berlin.de...
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")

"TNGgroup" <tn*@tnggroup.com> wrote in message
news:41**********************@news.skynet.be...
> 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
>
> "Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom> wrote in message
> news:Oq**************@TK2MSFTNGP14.phx.gbl...
> > TNGgroup wrote:
> > > 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
> > --
> > Microsoft MVP - ASP/ASP.NET
> > Please reply to the newsgroup. This email account is my spam trap

so I > > don't check it very often. If you must reply off-line, then remove the > > "NO SPAM"
> >
> >
>
>



Jul 22 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dariusz | last post by:
I have a problem where I need to pass two variables using GET from a form I have, to solve a page selection problem I have. The code is written that if a new visitor arrives at the front page of...
12
by: Kevin Lyons | last post by:
Hello, I am trying to get my select options (courses) passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html I am having difficulty getting the...
1
by: Kevin Lyons | last post by:
Hello, I am trying to get all of my form elements passed correctly from the following URL: http://www.dslextreme.com/users/kevinlyons/selectBoxes.html to the following URL:...
7
by: Dave A | last post by:
I have two events in a form that I am passing. One is to a javascript function, the other is to the same .asp page only with another action to show different data. Onchange is calls the...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
2
by: jonefer | last post by:
I'm using a Public variable that I set on one page so that it will be available for another page but, I know this isn't the way it should be done. Being an Access Developer, how would I do the...
4
by: assgar | last post by:
Hi I am stuck on a problem. I use 3 scripts(form, function and process). Development on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. The form displays...
7
by: Jason | last post by:
Hello I've got a very simple C# app, that has a datagrid, a text box, and a button which when clicked opens a second form... Form2 frm2 = new Form2(); frm2.Show(); When I place a datagrid,...
6
by: jej1216 | last post by:
I am trying to put together a PHP search page in which the user can select none, one, two, or three fields to search, and then the results php will build the SQL with dynamic where caluses to reflect...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.