House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Form button

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robert Orlini
05/04/2004 03:30 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Francis
05/04/2004 03:49 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
JerryEla
05/04/2004 09:21 PM

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 -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Semrau Steven Ctr SAF/IE
05/04/2004 03:47 PM

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   _____  

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dirk De Bock - Listclient
05/04/2004 04:23 PM

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     _____

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robert Orlini
05/04/2004 03:51 PM

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   _____   _____  

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Scott Brady
05/04/2004 04:54 PM

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/

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/05/2004 04:05 AM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

September 09, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30