|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Form button
Author: Pascal Peters
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162259
This has been around much longer. If I recall correctly it was
introduced in CF 4.0.1
----- Excess quoted text cut - see Original Post for more -----
Author: JerryEla
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162254
if C1 is an image button then when it is clicked form.C1.X and form.C1.Y
will exist and have as values the x and y coords within the image where
the mouse was clicked. form.C1 however will not exist. Note that C1.X
and C1.Y are two simple variables that contain dots in their name not a
struct with 2 keys.
BTY you should use StructKeyExists(form, "C1.X") instead of isDefined.
Robert Orlini wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Scott Brady
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162242
Original Message:
> From: "Dave Francis"
> Date: Tue, 4 May 2004 15:44:20 -0400
> Even when form.c1 isn't defined, the second test (after the "and") is still
evaluated.
This is only true in pre-MX versions of CF. In CFMX, if the left side of an AND
check returns false, it stops evaluating the rest of the if code.
(Similarly, I believe that if the left hand side of an OR check returns true, it
also stops evaluating)
Scott
---------------------------
Scott Brady
http://www.scottbrady.net/
Author: Dirk De Bock - Listclient
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162239
the form element will indeed be form.C1.X (and also form.C1.Y)
the value passed will be the x and y coordinates (ie where exactly the user
clicked on the button) so you will never see 'update' as the value of that form
element
Well, let's see IsDefined("form.C1.X") and form.C1 EQ "update"
First off I'd say just try adding .X
to form.C1 EQ "update" --> form.C1.X EQ "update".
Steven Semrau
SRA International
http://www.sra.com
I have an image as a form button as:
<input type="image" src="images/update.gif" name="C1" value="update">
In my CF code pressing this button should execute an update, however the
following code generates an error:
<CFIF IsDefined("form.C1.X") and form.C1 EQ "update">
Cold Fusion Server logged the following error information:
An error occurred while evaluating the expression:
IsDefined("form.C1.X") and form.C1 EQ "update"
Error near line 1, column 29.
Error resolving parameter FORM.C1
The specified form field cannot be found.
Am I missing something here?
Thanks.
Robert O.
HWW
_____
Author: Robert Orlini
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162236
Tried that. No errors but it does not run the update.
Well, let's see IsDefined("form.C1.X") and form.C1 EQ "update"
First off I'd say just try adding .X
to form.C1 EQ "update" --> form.C1.X EQ "update".
Steven Semrau
SRA International
http://www.sra.com
I have an image as a form button as:
<input type="image" src="images/update.gif" name="C1" value="update">
In my CF code pressing this button should execute an update, however the
following code generates an error:
<CFIF IsDefined("form.C1.X") and form.C1 EQ "update">
Cold Fusion Server logged the following error information:
An error occurred while evaluating the expression:
IsDefined("form.C1.X") and form.C1 EQ "update"
Error near line 1, column 29.
Error resolving parameter FORM.C1
The specified form field cannot be found.
Am I missing something here?
Thanks.
Robert O.
HWW
_____
_____
Author: Dave Francis
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162233
Even when form.c1 isn't defined, the second test (after the "and") is still
evaluated.
Try:
<cfparam name="form.c1" default="">
<CFIF form.C1 EQ "update">
or:
<cfif isDefined('FORM.c1')>
<cfif FORM.c1 eq 'update'>
I have an image as a form button as:
<input type="image" src="images/update.gif" name="C1" value="update">
In my CF code pressing this button should execute an update, however the
following code generates an error:
<CFIF IsDefined("form.C1.X") and form.C1 EQ "update">
Cold Fusion Server logged the following error information:
An error occurred while evaluating the expression:
IsDefined("form.C1.X") and form.C1 EQ "update"
Error near line 1, column 29.
Error resolving parameter FORM.C1
The specified form field cannot be found.
Am I missing something here?
Thanks.
Robert O.
HWW
Author: Semrau Steven Ctr SAF/IE
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162231
Well, let's see IsDefined("form.C1.X") and form.C1 EQ "update"
First off I'd say just try adding .X
to form.C1 EQ "update" --> form.C1.X EQ "update".
Steven Semrau
SRA International
http://www.sra.com
I have an image as a form button as:
<input type="image" src="images/update.gif" name="C1" value="update">
In my CF code pressing this button should execute an update, however the
following code generates an error:
<CFIF IsDefined("form.C1.X") and form.C1 EQ "update">
Cold Fusion Server logged the following error information:
An error occurred while evaluating the expression:
IsDefined("form.C1.X") and form.C1 EQ "update"
Error near line 1, column 29.
Error resolving parameter FORM.C1
The specified form field cannot be found.
Am I missing something here?
Thanks.
Robert O.
HWW
_____
Author: Robert Orlini
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32324#162226
I have an image as a form button as:
<input type="image" src="images/update.gif" name="C1" value="update">
In my CF code pressing this button should execute an update, however the
following code generates an error:
<CFIF IsDefined("form.C1.X") and form.C1 EQ "update">
Cold Fusion Server logged the following error information:
An error occurred while evaluating the expression:
IsDefined("form.C1.X") and form.C1 EQ "update"
Error near line 1, column 29.
Error resolving parameter FORM.C1
The specified form field cannot be found.
Am I missing something here?
Thanks.
Robert O.
HWW
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||