RE: Syntax is driving me nuts!

2013-08-20 Thread Rick Sanders

Thanks a lot guys. I still have a lot to learn about CF.

Kind Regards,

Rick Sanders
T: 902-401-7689
W: www.webenergy.ca



-Original Message-
From: DURETTE, STEVEN J [mailto:sd1...@att.com] 
Sent: Tuesday, August 20, 2013 12:56 PM
To: cf-talk
Subject: RE: Syntax is driving me nuts!


Try structkeyexists



If you really need to use isdefined, it would be:


Steve


-Original Message-
From: Rick Sanders [mailto:r...@webenergy.ca] 
Sent: Tuesday, August 20, 2013 11:49 AM
To: cf-talk
Subject: Syntax is driving me nuts!


Hey guys,

I'm trying to add multiple items to a database based on if a check box is 
checked.

This code works fine:


But I want to make sure the box is checked or not. When I do this:

I get: Element rel_1 is undefined in a Java object of type class 
coldfusion.filter.FormScope.

If I do this:

I get: Parameter 1 of function IsDefined, which is now form['rel_' & ar], must 
be a syntactically valid variable name.

I'm doing all this in a loop. The form's check boxes are defined as: 
rel_#currentrow#. Then I'm looping around them:

Numrows comes from the recordcount of the hidden form variable output query 
displaying the checkboxes.

All I need to know is what the right syntax I need to use for IsDefined?

Kind Regards,

Rick Sanders
T: 902-401-7689
W: www.webenergy.ca<http://www.webenergy.ca/>









~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356507
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Syntax is driving me nuts!

2013-08-20 Thread Captain Obvious

IsDefined("form.rel_#ar#")


On Tue, Aug 20, 2013 at 11:55 AM, Raymond Camden wrote:

>
> Use structKeyExists.
>
> 
>
>
>
> On Tue, Aug 20, 2013 at 10:48 AM, Rick Sanders  wrote:
>
> >
> > Hey guys,
> >
> > I'm trying to add multiple items to a database based on if a check box is
> > checked.
> >
> > This code works fine:
> > 
> >
> > But I want to make sure the box is checked or not. When I do this:
> > 
> > I get: Element rel_1 is undefined in a Java object of type class
> > coldfusion.filter.FormScope.
> >
> > If I do this:
> > 
> > I get: Parameter 1 of function IsDefined, which is now form['rel_' & ar],
> > must be a syntactically valid variable name.
> >
> > I'm doing all this in a loop. The form's check boxes are defined as:
> > rel_#currentrow#. Then I'm looping around them:
> > 
> > Numrows comes from the recordcount of the hidden form variable output
> > query displaying the checkboxes.
> >
> > All I need to know is what the right syntax I need to use for IsDefined?
> >
> > Kind Regards,
> >
> > Rick Sanders
> > T: 902-401-7689
> > W: www.webenergy.ca
> >
> >
> >
> >
> >
> >
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356506
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: Syntax is driving me nuts!

2013-08-20 Thread DURETTE, STEVEN J

Try structkeyexists



If you really need to use isdefined, it would be:


Steve


-Original Message-
From: Rick Sanders [mailto:r...@webenergy.ca] 
Sent: Tuesday, August 20, 2013 11:49 AM
To: cf-talk
Subject: Syntax is driving me nuts!


Hey guys,

I'm trying to add multiple items to a database based on if a check box is 
checked.

This code works fine:


But I want to make sure the box is checked or not. When I do this:

I get: Element rel_1 is undefined in a Java object of type class 
coldfusion.filter.FormScope.

If I do this:

I get: Parameter 1 of function IsDefined, which is now form['rel_' & ar], must 
be a syntactically valid variable name.

I'm doing all this in a loop. The form's check boxes are defined as: 
rel_#currentrow#. Then I'm looping around them:

Numrows comes from the recordcount of the hidden form variable output query 
displaying the checkboxes.

All I need to know is what the right syntax I need to use for IsDefined?

Kind Regards,

Rick Sanders
T: 902-401-7689
W: www.webenergy.ca<http://www.webenergy.ca/>







~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356505
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Syntax is driving me nuts!

2013-08-20 Thread Leigh

IsDefined does not accept array notation. You need to rewrite it using dot 
notation:

  IsDefined("form.rel_#ar#") 

or 

  IsDefined("form.rel_"& ar) 


The other option is to use StructKeyExists, which is generally preferred 
because it is a little more precise than isDefined:


  structKeyExists(form, "rel_"& 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356504
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Syntax is driving me nuts!

2013-08-20 Thread Raymond Camden

Use structKeyExists.





On Tue, Aug 20, 2013 at 10:48 AM, Rick Sanders  wrote:

>
> Hey guys,
>
> I'm trying to add multiple items to a database based on if a check box is
> checked.
>
> This code works fine:
> 
>
> But I want to make sure the box is checked or not. When I do this:
> 
> I get: Element rel_1 is undefined in a Java object of type class
> coldfusion.filter.FormScope.
>
> If I do this:
> 
> I get: Parameter 1 of function IsDefined, which is now form['rel_' & ar],
> must be a syntactically valid variable name.
>
> I'm doing all this in a loop. The form's check boxes are defined as:
> rel_#currentrow#. Then I'm looping around them:
> 
> Numrows comes from the recordcount of the hidden form variable output
> query displaying the checkboxes.
>
> All I need to know is what the right syntax I need to use for IsDefined?
>
> Kind Regards,
>
> Rick Sanders
> T: 902-401-7689
> W: www.webenergy.ca
>
>
>
>
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356503
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Syntax is driving me nuts!

2013-08-20 Thread Rick Sanders

Hey guys,

I'm trying to add multiple items to a database based on if a check box is 
checked.

This code works fine:


But I want to make sure the box is checked or not. When I do this:

I get: Element rel_1 is undefined in a Java object of type class 
coldfusion.filter.FormScope.

If I do this:

I get: Parameter 1 of function IsDefined, which is now form['rel_' & ar], must 
be a syntactically valid variable name.

I'm doing all this in a loop. The form's check boxes are defined as: 
rel_#currentrow#. Then I'm looping around them:

Numrows comes from the recordcount of the hidden form variable output query 
displaying the checkboxes.

All I need to know is what the right syntax I need to use for IsDefined?

Kind Regards,

Rick Sanders
T: 902-401-7689
W: www.webenergy.ca





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:356502
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm