Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

cfinput type=checkbox

Participant ,
Jun 08, 2010 Jun 08, 2010

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 ?

TOPICS
Getting started
571
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 08, 2010 Jun 08, 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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jun 08, 2010 Jun 08, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jun 08, 2010 Jun 08, 2010
LATEST

thanks Adam

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources