/t5/coldfusion-discussions/cfselect-required-not-working/td-p/103664Nov 06, 2008
Nov 06, 2008
Copy link to clipboard
Copied
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.
/t5/coldfusion-discussions/cfselect-required-not-working/m-p/103665#M10103Nov 06, 2008
Nov 06, 2008
Copy link to clipboard
Copied
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.
/t5/coldfusion-discussions/cfselect-required-not-working/m-p/103666#M10104Nov 06, 2008
Nov 06, 2008
Copy link to clipboard
Copied
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....
/t5/coldfusion-discussions/cfselect-required-not-working/m-p/103667#M10105Nov 06, 2008
Nov 06, 2008
Copy link to clipboard
Copied
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.