views:

95

answers:

1

I have a form field/checkbox and am unable to pass the boolean value even though it is selected.

 <input type="checkbox" name="IsContactValid"
               id=" IsContactValid" 
                  <cfif                        
                        ContactView.GetIsContactValid()>CHECKED
         </cfif>>
that will be transmitted to the receiving form if the box is checked.

Kindly help.

+6  A: 

You can give the check box a value:

 <input type="checkbox" name="IsContactValid" value="1"
               id=" IsContactValid" 
                  <cfif                        
                        ContactView.GetIsContactValid()>CHECKED
         </cfif>>

that will be transmitted to the receiving form if the box is checked.

Pekka
`checked="checked"` is more valid for more recent HTML standards.
Al Everett
I wouldn't say "more valid". CHECKED by itself is fine for HTML 4.01 and 5.
Henry
Yes but in this case CHECKED on its own did not work.
vas