Multiple submit forms on one page

P

Phillip Windell

This is really an HTML question I think, but it probably won't take
much effort to answer (unless I'm answering or course). The HTML is
all ASP generated and the ASP generates exactly what I want but the
resulting HTML isn't working right.

It consists of multiple forms on a page with each form using a unique
name. The submit button in each form also uses a unique name. The
forms are supposed to submit a single value from a hidden field in the
form called "btnID" that in the subsequent page gets put into an SQL
statement as a value for "ID = "blah, blah, blah".

The problem is that it is sending the values from every form instead
of just the one I submitted from and the values get concatenated by a
comma. I only want the one vlaue from the one form I submited. Is
this normal behavor or is something wrong with the forms. Below is the
forms with all the excess stuff stipped out so you can read it easier.

----------- HTML Code ------------
<Form Name='1' Action=showrecord.asp Method='POST'>
<Input Type='Submit' Name='btn1' Value='Select'>
<Input Type='Hidden' Name='btnID'
Value='{F171C6B2-2562-4FE1-8C63-3B42C67A363B}'
</Form>

<Form Name='2' Action=showrecord.asp Method='POST'>
<Input Type='Submit' Name='btn2' Value='Select'>
<Input Type='Hidden' Name='btnID'
Value='{F9896BFC-ADD3-4F5D-893E-785CBA0233F9}'
</Form>

<Form Name='3' Action=showrecord.asp Method='POST'>
<Input Type='Submit' Name='btn3' Value='Select'>
<Input Type='Hidden' Name='btnID'
Value='{CFFAFBCC-9AF1-4C59-A0A2-005434914E14}'
</Form>
------------- End HTML Code ---------------

Below is the SQL that the targe page produces.
As you can it is sending the value (a GUID) from each form separated
by commas instead of just the one GUID.

SELECT *
FROM tblShoots
WHERE Id = {F171C6B2-2562-4FE1-8C63-3B42C67A363B},
{F9896BFC-ADD3-4F5D-893E-785CBA0233F9},
{CFFAFBCC-9AF1-4C59-A0A2-005434914E14}

What am I doing wrong?
 
P

Phillip Windell

Ah! Two sets of eyes are always better than one. :)

Thank you sir! I'll check it out after lunch and see what happens.
 

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

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top