473,387 Members | 1,892 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

submitting two forms in same page?

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
5 4515
> 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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: belzibob | last post by:
I have inherited a table where each row is a <form> Each of these rows has only four columns, those being: 1) Item number 4) Quantity (blank textbox to fill in) 3) Description 4) Add link (to...
8
by: AC | last post by:
I hope someone can tell me why this is not working. I have a form that dynamically creates the code below. This is for one product and there are about 10 to 50 products that are listed depending...
2
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
5
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
5
by: Tyler Style | last post by:
Hullo - looking for a little advice here. I have a form on a page in one domain submitting to a cgi in another domain. Weirdly, on some Windows XP systems, a form on the page fails to submit/post...
2
by: Vinod I | last post by:
Hi Team, When I tryed following code, I am getting the Runtime Error as "The View State is invalid for this page and might be corrupted." Exception Details: System.Web.HttpException: The View...
7
by: FP | last post by:
This should be simple but I just can't seem to figure it out. I have a form with 2 checkboxes in it. Clicking either checkbox runs a js function which opens a new window. The form targets that...
4
by: paratge | last post by:
Hi, I'm updating one form in an iframe, with another in a main page. That works fine, th probliem is how to submit two forms with one click. For now i get an error "permission denied" how can...
3
by: erobinso | last post by:
I have a page that makes use of a tiny/hidden IFRAME that becomes triggered to load HTML into a SPAN element (via .innerHTML). The SPAN expands to display a form that then needs to be validated with...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.