Skip to main content
July 25, 2008
Question

cfinput required=yes not working

  • July 25, 2008
  • 1 reply
  • 499 views
I am running an application with many forms with cfinput tags. Many of them require the user to input some sort of data.. some validated some not. The required attribute works on all but one of my forms. I do have the scripssrc="/scripts" attibute added adn the cfform.js in the right location.


Any ideas?

<CFFORM ACTION="TrackingActProcess.cfm?SubJobNumber=#URL.SubJobNumber#&JobNumber=#URL.JobNumber#" scriptsrc="/scripts">

....

<CFSELECT NAME="ActivityID"
VALUE="ActivityID"
QUERY="qu"
DISPLAY="ActivityID"
SELECTED="#VARIABLES.ActivityID#"
REQUIRED="yes"
WIDTH="200"
MESSAGE="Select ActivityID"> </CFSELECT>
    This topic has been closed for replies.

    1 reply

    July 25, 2008
    Unfortunately I do not believe that the required attribute will work if you are attempting to do a drop down menu using cfselect. The required attribute will work if you specify the "size" of the cfselect to be 2 or greater.

    For example, try this:
    <CFSELECT NAME="ActivityID"
    SIZE="5"
    VALUE="ActivityID"
    QUERY="qu"
    DISPLAY="ActivityID"
    SELECTED="#VARIABLES.ActivityID#"
    REQUIRED="yes"
    WIDTH="200"
    MESSAGE="Select ActivityID"> </CFSELECT>