Watch out though, the name of the button is only in the form scope if the
button is pressed. If the form is submitted via the enter key (in IE),
then the button was not pressed and the name of it will be undefined.

Make sure you check for that, or include a hidden field with the same
name.

> Yeah the name of the button is in the form scope.
>
> -Shawn Regan
>
> -----Original Message-----
> From: Scott Van Vliet [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 20, 2002 5:04 PM
> To: CF-Talk
> Subject: RE: two SUBMIT buttons on a form?
>
>
> Does that work in Netscape?
>
> -----Original Message-----
> From: Sam Roach [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 20, 2002 5:00 PM
> To: CF-Talk
> Subject: RE: two SUBMIT buttons on a form?
>
> you could set a name for you submit buttons.  On you process page do a
> include based on which button was clicked.
>
> EX:
>
> <form action="go.cfm">
>
>  <input type="submit" value="x1" name="click_x1">
>  <input type="submit" value="x2" name="click_x2">
> </form>
>
> --------------
> go.cfm
>
> <cfif isdefined("click_x1")>
>       <cfinclude template="x1_process.cfm">
> <cfelseif isdefined("click_x2")>
>       <cfinclude template="x2_process.cfm">
> </cfif>
> -----------------
>
>
> -- Sam
>
>
> -----Original Message-----
> From: Ed Gordon [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 20, 2002 4:54 PM
> To: CF-Talk
> Subject: two SUBMIT buttons on a form?
>
>
> Is there a simple way to have two buttons on the bottom of a form, one
> which
> goes to one .cfm and one to another, and yet have both process the
> entered
> form data on the way?
>
> I would of course label them differently, such as NEW and COPY, or for
> similar functions.
>
> TIA
> Ed Gordon
>
> FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists
>
>
> 
______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to