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