Can anyone see something wrong with this, working on CFMX but failing on CF5
function formValue(formName, defaultValue) {
if ( IsDefined("FORM.#ARGUMENTS.formName#") ) {
return HTMLEditFormat(FORM["#ARGUMENTS.formName#"]);
} else {
return HTMLEditFormat(ARGUMENTS.defaultValue);
}
}
Er
in CF5 arguments is an array:
try: IsDefined("FORM.#ARGUMENTS[1]#")
I think that will work on MX too.
HTH
Bert
- Original Message -
From: Adrian Lynch <[EMAIL PROTECTED]>
Date: Tue, 31 Aug 2004 16:22:29 +0100
Subject: Second Pair Of Eyes
To: CF-Talk <[EMAIL PROTECTE
You don't need the #'s inthe isDefined - just the FORM.whatever variable.
I don't have a means to test this right now, but this jumped out at me.
Rau
At 11:22 AM 8/31/2004, you wrote:
>Can anyone see something wrong with this, working on CFMX but failing on CF5
>
>
>function formValue(formName,
Have you tried usinge structkeyexits() instead of isDefined()
- Original Message -
From: Adrian Lynch <[EMAIL PROTECTED]>
Date: Tue, 31 Aug 2004 16:22:29 +0100
Subject: Second Pair Of Eyes
To: CF-Talk <[EMAIL PROTECTED]>
Can anyone see something wrong with this, working
This works on CF5
function formValue(formName, defaultValue) {
if (structKeyExists(FORM, formName) ) {
return HTMLEditFormat(FORM[formName]);
} else {
return HTMLEditFormat(defaultValue);
}
}
Arguments is an array rather than a structure
--
dc
ubject: Re: Second Pair Of Eyes
You don't need the #'s inthe isDefined - just the FORM.whatever variable.
I don't have a means to test this right now, but this jumped out at me.
Rau
At 11:22 AM 8/31/2004, you wrote:
>Can anyone see something wrong with this, working on CFMX but
He does if the the form element he's looking for is named by an
argument in his function, i.e. getFormElement("myform") - if this
function does anything with the value of "form.myform", then he does
need the #'s.
Although I tend to use structkeyexists() for this. In which case there
wouldn't be #'
It also works fine on MX.
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 31 August 2004 16:46
To: CF-Talk
Subject: RE: Second Pair Of Eyes
This works on CF5
function formValue(formName, defaultValue) {
if (structKeyExists(FORM, formName
In cf5, arguments is an array. Just use formName and defaultValue
without a prefix (or arguments[1] and arguments[2]).
Pascal
> -Original Message-
> From: Adrian Lynch [mailto:[EMAIL PROTECTED]
> Sent: 31 August 2004 17:22
> To: CF-Talk
> Subject: [Spam?] Second Pair O
> Arguments is an array rather than a structure
If I recall correctly, the Arguments "object" is exposed as both an array
and a structure.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
phone: 202-797-5496
fax: 202-797-5444
[Todays Threads]
[This Message]
[Subscription]
[Fast U
Not in CF5. That is where the problem was.
Pascal
> -Original Message-
> From: Dave Watts [mailto:[EMAIL PROTECTED]
> Sent: 31 August 2004 18:40
> To: CF-Talk
> Subject: [Spam?] RE: Second Pair Of Eyes
>
> > Arguments is an array rather than a structure
>
&
>> Arguments is an array rather than a structure
> If I recall correctly, the Arguments "object" is exposed
> as both an array
> and a structure.
> Dave Watts, CTO, Fig Leaf Software
> http://www.figleaf.com/
> phone: 202-797-5496
> fax: 202-797-5444
On MX you're right, although the original que
dc said...
> >> Arguments is an array rather than a structure
dave watts said...
> > If I recall correctly, the Arguments "object" is exposed
> > as both an array
> > and a structure.
s. isaac dealey said...
> On MX you're right, although the original question was on CF5.
OK... run th
13 matches
Mail list logo