Skip to main content
Inspiring
June 8, 2010
Question

cfinput type=checkbox

  • June 8, 2010
  • 3 replies
  • 609 views

I expected the checkbox to send a true or false , but it appears if it's not checked it doesn't get sent in the form collection ?

so instead of checking if form.checkbox EQ "Y" , instead I do this

if isDefined("form.checkbox")

is this correct ?

This topic has been closed for replies.

3 replies

Inspiring
June 8, 2010

thanks Adam

Inspiring
June 8, 2010

It's one of the ways that work.  Others include StructKeyExists or hidden form fields. 

Inspiring
June 8, 2010

if isDefined("form.checkbox")

structKeyExists() is more robust than isDefined(), but that's the general idea, yeah.

More reading for you:

http://www.w3.org/TR/REC-html40/interact/forms.html#checkbox

--
Adam