Two Submits?

J

James Baker

Once again, trying to re-learn ASP with all of my might. Probably a simple
problem, but here goes:

I have a form that current has a fair amount of data/input tags and a button
that submits it to another page for processing. I'm building another button
on this same page that will post to an entirely different page, but needs a
lot of the same data as the original button. I assume I can't have both
submit buttons within the same form, yet I need access to the same data.
I'm probably missing something pretty obvious, but I can't figure this out
for the life of me.

TIA,
James
 
P

Patrice

You can change the "action" attribute of the form tag to change the page to
which you submit those data. All dates within the form tag will be submitted
(you can just ignore those you don't want).
Looks a bit weird (don't you loose some changes if you clicked on the
"wrong" button ?)

My personal preference is to submit to the same page. You can test which
button was clicked (you'll get the value of the pressed button server side
so that you can perform the appropriate action.

Patrice
 
A

Aaron [SQL Server MVP]

Why does it have to be a submit button?

<input type=button onclick='...do some javascript stuff and submit the
form...'>

Not really an ASP question, you should find techniques for changing the
form's action parameter (depending on the button clicked) in a client-side
group, like microsoft.public.scripting.jscript
 

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,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top