submitting two forms in same page?

B

Bjorn

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
 
J

Jeff

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
 
B

Bjorn

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")
....
 

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

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top