Skip to main content
Inspiring
May 1, 2009
Question

validate 'x' amount of select field's using cfloop

  • May 1, 2009
  • 1 reply
  • 398 views

I have a cfloop to output "x" many select's in a form that a user specify's to display.

On form submission I want to validate that each of their "x" many form fields has been chosen.

    (if user wanted to display 5, they shouldn't just do 3 of them)

How do I use this <cfloop index="loopcount" from="1" to="#form.Multi#"> to get my cfif to work?

..i'm trying something like <cfif (form.select_1 is 'none') or (form.select_2 is 'none') ..etc> but how do u tell it to keep going?

...and i'm sure there is a better method.

Thanks.

This topic has been closed for replies.

1 reply

ilssac
Inspiring
May 1, 2009

539E wrote:

...and i'm sure there is a better method.

Yup, array notation.

<cfif form["select_" & loopcount] is none>