If you are using images as submit buttons and detecting whether they have
been clicked or not you need to follow the control with a ".x" i.e. if you
have 2 images as submit buttons with names image1 and image2 and you want to
test in your action page whether the user clicked image1 you need <cfif
ISDefined("form.image1.x")>
-----Original Message-----
From: Terri Stocke [mailto:[EMAIL PROTECTED]]
Sent: 23 May 2001 16:27
To: CF-Talk
Subject: Re: 2 submit buttins with one action
Ben, try this code below. You just have to change the first line to see
which button was pressed. So if sendemail was clicked, it would be defined.
Otherwise the other button would be passed and your cfelse clause would be
executed. I know it works with regular buttons--I've never tried it with
images used as buttons...
<cfif isdefined("form.sendemail")>
<cflocation
url="editemail.cfm?edit=send&salesperson=#SalesPerson#&email=#Email#&SalesEm
ail=#SalesEmail#&location=#location#&customerID=#customerID#&Reply=#Reply#">
<cfelse>
<cflocation
url="editemail.cfm?salesperson=#SalesPerson#&email=#Email#&SalesEmail=#Sales
Email#&location=#location#&customerID=#customerID#&Reply=#Reply#">
</cfif>
----Original Message Follows----
From: "Ben Densmore" <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: CF-Talk <[EMAIL PROTECTED]>
Subject: 2 submit buttins with one action
Date: Wed, 23 May 2001 10:53:20 -0400
I hope someone can help me, I'm a little stuck. I have a form that has two
images that are used to submit a form. They both use the same action but in
my action file I am checking to see which button was pushed. Should this
work? I have named my form and named each button. Here is the code I'm
trying to use.
<cfif form.email is "sendemail">
<cflocation
url="editemail.cfm?edit=send&salesperson=#SalesPerson#&email=#Email#&SalesEm
ail=#SalesEmail#&location=#location#&customerID=#customerID#&Reply=#Reply#">
<cfelse>
<cflocation
url="editemail.cfm?salesperson=#SalesPerson#&email=#Email#&SalesEmail=#Sales
Email#&location=#location#&customerID=#customerID#&Reply=#Reply#">
</cfif>
my form name is called email and one button has a name called edit email and
the other is sendemail.
Thanks,
Ben Densmore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists