This solution gives me one checked checkbox when the page loads.
What I am trying to do is have the list of checkboxes show (which my code is doing correctly), but to ensure that at least one is selected when the Submit button is clicked.
I can find a lot of solutions using <form>, but I want to use <cfform> and have an error message display if one is not selected - preferably either on the same page or in a popup. I don't 't want the user to have to click the back button to fix the form.
Main Topics
Browse All Topics





by: myselfrandhawaPosted on 2009-10-14 at 20:29:25ID: 25577002
I am not sure what exactly you are trying to do here but you can try like this:
input type="checkbox" value="#TypeOfContactID#" name="ContactType" checked>#TypeOfContact#</td> input type="checkbox" value="#TypeOfContactID#" name="ContactType">#TypeOfC ontact#</td >
<cfoutput query="getContactType" startrow=#start# maxrows=#max#>
<cfif typeofcontactID IS 'yes'>
<td class="homepage_content"><cf
<cfelseif TypeOfContactID IS 'no'>
<td class="homepage_content"><cf
</cfif>
</cfoutput>