Skip to main content
Inspiring
November 6, 2008
Question

cfselect required not working

  • November 6, 2008
  • 3 replies
  • 616 views
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.
    This topic has been closed for replies.

    3 replies

    Inspiring
    November 6, 2008
    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".
    Inspiring
    November 6, 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
    Inspiring
    November 6, 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.