|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Form button
I have an image as a form button as:Robert Orlini 05/04/04 03:30 P Even when form.c1 isn't defined, the second test (after the "and") is still evaluated.Dave Francis 05/04/04 03:49 P if C1 is an image button then when it is clicked form.C1.X and form.C1.YJerryEla 05/04/04 09:21 P Well, let's see IsDefined("form.C1.X") and form.C1 EQ "update"Semrau Steven Ctr SAF/IE 05/04/04 03:47 P the form element will indeed be form.C1.X (and also form.C1.Y)Dirk De Bock - Listclient 05/04/04 04:23 P Tried that. No errors but it does not run the update.Robert Orlini 05/04/04 03:51 P Original Message:Scott Brady 05/04/04 04:54 P This has been around much longer. If I recall correctly it wasPascal Peters 05/05/04 04:05 A 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 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 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 ----- 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 _____ 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 _____ 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 _____ _____ 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/ 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 -----
|
September 09, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||