2 Replies Latest reply on Jun 29, 2009 8:46 PM by Dileep_NR



      I have a form with multiple checkboxes for insurance types. If one or more are checked the insert works properly. However, if none are checked, I get an error that the field is "undefined in form". My action page insert query is written "<CFQUERYPARAM CFSQLType="CF_SQL_Varchar" Value="#Form.VCTM_REIMBRS_TYPE#" Null="#Len(Form.VCTM_REIMBRS_TYPE) EQ 0#">" and the SQL field is checked to allow NULLS. What am I missing?

        • 1. Re: Checkbox
          Dan Bracuk Level 5

          For check boxes, if none are checked on the form, the form variable will not exist.  There are several ways to deal with this.  You must first, however, decide in plain english what you want to happen if nothing is checked.  Translating that decision to code is usually simple.

          1 person found this helpful
          • 2. Re: Checkbox
            Dileep_NR Level 2



            Check the Form.VCTM_REIMBRS_TYPE isdefined



            <cfif isdefined("Form.VCTM_REIMBRS_TYPE") AND len(trim(Form.VCTM_REIMBRS_TYPE))>