Highlighted

cfif statement

Explorer ,
Sep 13, 2017

Copy link to clipboard

Copied

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> 

Views

149

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

cfif statement

Explorer ,
Sep 13, 2017

Copy link to clipboard

Copied

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> 

Views

150

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 13, 2017 0
BKBK LATEST
Adobe Community Professional ,
Sep 14, 2017

Copy link to clipboard

Copied

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'>.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Sep 14, 2017 0