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

cfif statement

Explorer ,
Sep 13, 2017 Sep 13, 2017

I have a cfselect and when a user selects Vendor from the list, a div displays showing a company field to enter the company name. I am trying to get to the logic that checks if Vendor is selected, make the company field required`. Here is what i got so far.

When I fill out the form and choose vendor the div with the company field displays but I cannot make it required

Thank you!

<cfif form1.county EQ 'Vendor'>

                         

                                <cfinput type="text" name="company" id="company" width="190" message="Please enter your company name." required="yes" >

                               

                          <cfelse>

                         

                           <cfinput type="text" name="company"  id="company" width="190" message="Please enter your company name." >

                           </cfif> 

288
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
Community Expert ,
Sep 14, 2017 Sep 14, 2017
LATEST

I think the if-test returns false and what you're seeing is the bottom <cfinput>. A more accurate test is <cfif form.county EQ 'Vendor'>.

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