On Mon, Jul 12, 2004 at 08:57:58AM +1000, Scott Thornton wrote:

> I am creating a bunch of checkboxes on the the fly with a cfloop.
> 
> How do i check for their existance in an action page (within a cfloop)?
> 
> ISDEFINED("FORM[RECLAIM_ & loopindex]")  returns this error:
> 
> Parameter 1 of function IsDefined, which is now "FORM[RECLAIM_ &
> loopindex]", must be a syntactically valid variable name.
> 
> and
> 
> ISDEFINED("FORM["RECLAIM_" & loopindex]") causes "Invalid CFML construct
> found"

Since the FORM is a structure, try:   StructKeyExists(form,"RECLAIM_#loopindex")

Another thing you might like to do is predefine the variables. By that I
mean if you know you'll be looking for checkboxes, add a hidden field
with the same name and no value. That way the form variable will always
exist.

ie:  <input type="checkbox" name="foo">
     <input type="hidden" name="foo" value="">

Since they're the same name the values will get concatenated when it
gets posted.

Cheers

Paul Haddon
Technical Services Manager
Formstar Print Technologies


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to