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

cfselect required not working

Participant ,
Nov 06, 2008 Nov 06, 2008
Does anyone know why this is not working? I am trying to find a way to require someone to enter a state in a select dropdown. CFSELECT REQUIRED="YES" does not work. I can't find anything online about how to do it another way.
597
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 ,
Nov 06, 2008 Nov 06, 2008
The required attribute of cfselect is a cruel joke because it doesn't do anything. To do it another way, write a javascript function to check the value of the select and call it when you submit your form.
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
Engaged ,
Nov 06, 2008 Nov 06, 2008
Unfortunately I'm not at a machine with CF on it but have you tried playing with an empty or null value as the default? And to cut right to the chase you can always View Page Source of the loaded form page and see what the javascript is actually coded for....

HTH,

Rich
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 ,
Nov 06, 2008 Nov 06, 2008
LATEST
I'm pretty sure that the only way to get the cfselect required="yes" to work is to set it to select multiple. If it's not set to multiple then something is always selected, null value or not.

Go the JS route, to make it "required".
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