Someone (sorry, I've forgotten who) posted this a while back, and I've used
it with great success:
In your JavaScript do this.
function goSubmit(pg) {
if(pg == "Pone") {
document.MyForm.action="thefirstpage.cfm"
}else{
document.MyForm.action="thesecondpage.cfm"
}
document.MyForm.submit();
}
then create a form
<form action="onepage.cfm" name="MyForm">
<input type="whatever">
<input type="whatever">
<input type="whatever">
<input type=button value="go to first page"
onClick="goSubmit(Pone)">
<input type=button value="go to second page"
onClick="goSubmit(Ptwo)">
In this scenario, the buttons send in arguments to
the javascript so that it
determines the action of the form. Now the form is
able to submit to two
places
including all of the form field variables.
D
*************
Diana Nichols
Webmistress
http://www.lavenderthreads.com
770.434.7374
"One man's magic is another man's engineering." ---Lazarus Long
-----Original Message-----
From: W Luke [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 29, 2001 1:07 PM
To: CF-Talk
Subject: One form, two submit buttons...
Hi,
I have a form that is posted to a processing page. I want to add another
button that submits the form information to another page, if the user
wishes, which will preview what it will look like.
How can I do this?
Cheers.
--
Will
Free Classifieds -=- www.localbounty.com
e: [EMAIL PROTECTED] icq: 31099745
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists