We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Trying to use channel:form tag for checkbox field (multiple)

How Do I?

MacMastermind's avatar
MacMastermind
118 posts
9 years ago
MacMastermind's avatar MacMastermind

Can’t find an answer anywhere. I’m just trying to use the simple channel:form tag to have a user check one or more items from an option list field and then submit the record. I can do the select method for the drop-down list, but I can’t find any info on how to do a checkbox form field…

Any help is appreciated. Thanks!

-Tony

       
Rob Allen's avatar
Rob Allen
2,950 posts
9 years ago
Rob Allen's avatar Rob Allen

Have you got a checkbox field set up as a channel custom field?

       
MacMastermind's avatar
MacMastermind
118 posts
9 years ago
MacMastermind's avatar MacMastermind

Yes. I did finally find the custom_fields tag pair and massaged that to my purposes.

Thank you!

       
MacMastermind's avatar
MacMastermind
118 posts
9 years ago
MacMastermind's avatar MacMastermind

For those curious, this is how I solved it (all done inside the channel:form tag):

{custom_fields}
 {if field_name=="YOURFIELDNAMEGOESHERE"}
  Weekly Achievement Awards:
    {options:YOURFIELDNAMEGOESHERE}
                 <br>
            
          <input type="checkbox" id="{field_name}" name="{field_name}[]" value="{option_value}"{checked}>
                <label class="checkbox">{option_value}</label>
      {/options:YOURFIELDNAMEGOESHERE}
 {if:elseif field_name=="YOURONLYOTHERCHECKBOXFIELDNAMEGOESHERE"}
  Squadron Build Award: 
    {options: YOURONLYOTHERCHECKBOXFIELDNAMEGOESHERE}
                 <br>
     
   <input type="checkbox" id="{field_name}" name="{field_name}[]" value="{option_value}"{checked}>
         <label class="checkbox">{option_value}</label>
      {/options: YOURONLYOTHERCHECKBOXFIELDNAMEGOESHERE}
 {/if}
{/custom_fields}
       
Eastwood Design's avatar
Eastwood Design
605 posts
7 years ago
Eastwood Design's avatar Eastwood Design

how would this work if I wanted to display my categories as checkboxes? (NSPA)

       

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.