By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,101 Members | 1,335 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,101 IT Pros & Developers. It's quick & easy.

submitting two forms in same page?

P: n/a
Hi,

I need to submit in the same page two forms to two different ASP-pages.
I created two forms, each with hidden input and a submit button. But it
doesn't work. Nothing happens with the second form.
Does it exist a way to do that?

Thanks
bjorn
Jul 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
> I need to submit in the same page two forms to two different ASP-pages.
I created two forms, each with hidden input and a submit button. But it
doesn't work. Nothing happens with the second form.
Does it exist a way to do that?


Well, it should work - post more details here.

Brian

Jul 19 '05 #2

P: n/a
just out of curiousity... why go to two different asp pages?? can't you use
the form data to do two different things on the same page of scripts??
Jeff
"Bjorn" <no****@rt.sw> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
Hi,

I need to submit in the same page two forms to two different ASP-pages.
I created two forms, each with hidden input and a submit button. But it
doesn't work. Nothing happens with the second form.
Does it exist a way to do that?

Thanks
bjorn

Jul 19 '05 #3

P: n/a
Thanks for replying.
I made an application where the user has to choose several values from a
list but each on a next stage. In the first page, the user has to chooe a
dayin a Select, that information is sent to the next page (with a form); in
the second page, the user must choose a hour (which is dependantly of the
day chosen), that information and the day are sent to the next page; there,
the user must choose a computernumber. The final reservation occurs in a 4th
page (with a form like always).

And now my problem: the user must be able to go back to the second stage in
the case he wants to change his choice of hours. So i also did it with
another form in order to pass the already chosen day, because otherwise, the
user will change the hour, going then to the 3th stage (the computer choice)
but without day.
But nothing happens when i click on the second submit button (step2). Look
the code:
<form id=ins method="post">
<input id=ruur type="hidden" value="" >
<input id=rdag type="hidden" value="" >
<input id=rpc type="hidden" value="" >
<INPUT id=smt TYPE="submit" value="reservation" >
</form>

<form id=ins2 method="post">
<input id=rdag2 type="hidden" value="" >
<input id=rpc2 type="hidden" value="" >
<INPUT id=step2 TYPE="submit" value="go back to the hours" >
</form>
......
<script type="text/javascript">
function resonclick()
{
pc=document.getElementById("pcnr").value //chosen computer in the
list
document.getElementById("ruur").value=hr //chosen hour into hidden
field
document.getElementById("rdag").value=dat //chosen day into hidden
field
document.getElementById("rpc").value=pc // chosen computer into
hidden field
document.getElementById("ins").action="insert.asp" //reservation occurs
here: this works
document.getElementById("ins").submit
return true;
}

function step2onclick()
{
document.getElementById("rdag2").value=dat // to send the chosen
day to the hour-page
document.getElementById("ins2").action="stage2.asp "
document.getElementById("ins2").submit
return true;
}

document.getElementById("pcnr").onclick = resonclick //pcnr=list
of computer in a select
document.getElementById("step2").onclick = step2onclick //nothing
happens, no errors

</script>

The "stage2.asp code":
<%
dat=request.form("rdag2")
....



"Jeff" <gi****************@verizon.net> wrote in message
news:uV*************@TK2MSFTNGP12.phx.gbl...
just out of curiousity... why go to two different asp pages?? can't you use the form data to do two different things on the same page of scripts??
Jeff
"Bjorn" <no****@rt.sw> wrote in message
news:uy**************@TK2MSFTNGP10.phx.gbl...
Hi,

I need to submit in the same page two forms to two different ASP-pages.
I created two forms, each with hidden input and a submit button. But it
doesn't work. Nothing happens with the second form.
Does it exist a way to do that?

Thanks
bjorn


Jul 19 '05 #4

P: n/a
Bjorn,

Your code was incomplete... and you appeared to be referencing non-existant
controls. Anyway, this should get you going...

<form id=ins method="post">
<input id=ruur type="hidden" value="" >
<input id=rdag type="hidden" value="" >
<input id=rpc type="hidden" value="" >
<INPUT id=smt TYPE="submit" value="reservation" >
</form>
<form id=ins2 method="post">
<input id=rdag2 type="hidden" value="" >
<input id=rpc2 type="hidden" value="" >
<INPUT id=step2 TYPE="submit" value="go back to the hours" >
</form>
</body>
<script type="text/javascript">
function resonclick()
{
//pc=document.getElementById("pcnr").value //chosen computer in the list
document.getElementById("ruur").value="hr" //chosen hour into hidden
field
document.getElementById("rdag").value="dat" //chosen day into hidden
field
document.getElementById("rpc").value="pc" // chosen computer into
hidden field
document.getElementById("ins").action="insert.asp" //reservation occurs
here: this works
document.getElementById("ins").submit
return true;
}

function step2onclick()
{
document.getElementById("rdag2").value="dat" // to send the chosen
day to the hour-page
document.getElementById("ins2").action="stage2.asp "
document.getElementById("ins2").submit
return true;
}

document.getElementById("smt").onclick = resonclick //pcnr=list of
computer in a select
document.getElementById("step2").onclick = step2onclick //nothing
happens, no errors

</script>

Brian

Jul 19 '05 #5

P: n/a
thanks

"Brian Staff" <brianstaff@[NoSpam]compuserve.com> wrote in message
news:VA.0000028d.8c2b143e@bstaffw2k...
Bjorn,

Your code was incomplete... and you appeared to be referencing non-existant controls. Anyway, this should get you going...

<form id=ins method="post">
<input id=ruur type="hidden" value="" >
<input id=rdag type="hidden" value="" >
<input id=rpc type="hidden" value="" >
<INPUT id=smt TYPE="submit" value="reservation" >
</form>
<form id=ins2 method="post">
<input id=rdag2 type="hidden" value="" >
<input id=rpc2 type="hidden" value="" >
<INPUT id=step2 TYPE="submit" value="go back to the hours" >
</form>
</body>
<script type="text/javascript">
function resonclick()
{
//pc=document.getElementById("pcnr").value //chosen computer in the list document.getElementById("ruur").value="hr" //chosen hour into hidden field
document.getElementById("rdag").value="dat" //chosen day into hidden field
document.getElementById("rpc").value="pc" // chosen computer into hidden field
document.getElementById("ins").action="insert.asp" //reservation occurs
here: this works
document.getElementById("ins").submit
return true;
}

function step2onclick()
{
document.getElementById("rdag2").value="dat" // to send the chosen day to the hour-page
document.getElementById("ins2").action="stage2.asp "
document.getElementById("ins2").submit
return true;
}

document.getElementById("smt").onclick = resonclick //pcnr=list of computer in a select
document.getElementById("step2").onclick = step2onclick //nothing
happens, no errors

</script>

Brian

Jul 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.