Les,

Another way to do this is to simply use multiple forms on the same page, each having a 
different processing file in the respective form's action attribute.  In this way, 
only the form's values that you are submitting will be sent to the action page.  Of 
course, this is only a good thing if you want to keep only specific data from your 
form page.

For example:

<form name="Form1" action="action1.cfm" method="post">
        <input type="text" name="Form1DataField" value="something">
        <input type="submit" value="Form1Submit">
</form>

<form name="Form2" action="action2.cfm" method="post">
        <input type="text" name="Form2DataField" value="something">
        <input type="submit" value="Form2Submit">
</form>

<form name="Form3" action="action3.cfm" method="post">
        <input type="text" name="Form3DataField" value="something">
        <input type="submit" value="Form3Submit">
</form>

Also, be sure not to accidentally nest your forms if you use more than 1 on a page.

-Andy 

> -----Original Message-----
> From: Scott, Andrew [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 20, 2001 11:04 PM
> To: CF-Talk
> Subject: RE: Multiple submit buttons on a form
> 
> 
> 
> <form name="whatever" action="action.cfm" method="post">
>  <input type="submit" name="Testme" value="Save">
>  <input type="submit" name="Testme" value="Test">
> </form>
> 
> And in your action.cfm page:-
> 
> <cfif IsDefined("Testme")>
>  <cfswitch expression=#Testme#>
>   <cfcase value="Save">
>     Place code here for Save Action.
>   </cfcase>
>   <cfcase value="Test">
>     Place code here for Test Action.
>   </cfcase>
>  </cfswitch>
> </cfif>
> 
> If you wanted to different pages instead, just place cfincludes 
> between the
> cfcase's....
> 
> Hope this helps...
> 
> 
> -----Original Message-----
> From: stas [mailto:[EMAIL PROTECTED]]
> Sent: 21 February 2001 17:43
> To: CF-Talk
> Subject: RE: Multiple submit buttons on a form
> 
> 
> It's quite easy if you use images as submit buttons because you can do a
> switch based on the name passed with the form variable.
> 
> -----Original Message-----
> From: Les Irvin [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 20, 2001 7:15 PM
> To: CF-Talk
> Subject: Multiple submit buttons on a form
> 
> 
> How would one put multiple submit buttons on a single form, each calling a
> different page upon submit?
> Thanks,
> Les
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to