submit form to multiple pages

S

Slug

Hello,
I've tried to find this answer, but can't seem to get a clear example -

I'm using the following classic asp code to submit a form:
<form action="default.asp" name=order method=post>

What I need to do is to submit the form to multiple .asp pages, (that I
want to join with frames) and I can't find a way to do it.

Thanks.
 
J

Just1Coder

Slug said:
Hello,
I've tried to find this answer, but can't seem to get a clear example -

I'm using the following classic asp code to submit a form:
<form action="default.asp" name=order method=post>

What I need to do is to submit the form to multiple .asp pages, (that I
want to join with frames) and I can't find a way to do it.

Thanks.
Not very efficient, but you could carry the form variables over after
the first post to a second, third.. etc...

top of defalut.asp
dim frmval1, frmval2
frmval1 = request.form("frmval1")
frmval2 = request.form("frmval2")

process the form here...

... at the end of default.asp..

if err.number <> and all other business rules = true then
response.redirect("action2.asp?frmval1=frmval1&fmrval2=frmval2")
end if
 
J

John

Use Javascript.

<html>

<head>
<script type="text/javascript">
function formSubmit()
{
document.forms.myForm.action="action1.asp"
document.forms.myForm.submit()
document.forms.myForm.action="action2.asp"
document.forms.myForm.submit()
}
</script>
</head>

<body>
<form name="myForm" method="get">
Firstname: <input type="text" name="firstname" size="20"><br />
Lastname: <input type="text" name="lastname" size="20"><br /><br />
<input type="button" onclick="formSubmit()" value="Submit">
</form>
</body>

</html>
 
A

Aaron [SQL Server MVP]

You can do one of three things:

- submit to form1, then use hidden form variables to submit to form2 (maybe
using a hidden frame)
- post the value of request.form to form2 using MSXML
(http://www.aspfaq.com/2173)
- combine the functionality of both forms so that you only need to submit to
one page

I strongly recommend against using frames. They mess with the browser's
bookmarks and history, and very rarely provide functionality that a
non-framed page provides. Besides, they won't help you solve this issue.
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top