2

I have been trying to get P&T's Dropdown as well as Checkboxes to work with Channel Forms but I do not seem to have any success as of yet. I have tried using

    {my_field_name}
            <option value="{option_value}"{selected}>{option_value}</option>
    {/my_field_name}

and

    {options:my_field_name}
            <option value="{option_value}"{selected}>{option_name}</option>
    {/options:my_field_name}

and

    {my_field_name:options}
            <option value="{option_value}"{selected}>{option_name}</option>
    {/my_field_name:options}

with no success. Does anyone know where i could be going wrong?

2 Answers 2

1

Kindly got an answer from the great guys over at Pixel and Tonic. You need to add this to your expressionengine config file.

$config['safecracker_option_fields'][] = 'fieldpack_checkboxes';
$config['safecracker_option_fields'][] = 'fieldpack_radio_buttons';
$config['safecracker_option_fields'][] = 'fieldpack_dropdown';
$config['safecracker_option_fields'][] = 'fieldpack_multiselect';
$config['safecracker_option_fields'][] = 'fieldpack_pill';

Once that has been added to your config file, you can use P& T Dropdown with channel forms using this code

{options:my_field_name}
     <option value="{option_value}"{selected}>{option_value}</option>
{/options:my_field_name}

and you can use the P&T Checkboxes using this code.

{options:my_field_name}
    <label class="checkbox">
        <input type="checkbox" id="{my_field_name}" name="{my_field_name}[]" value="{option_value}"{checked}>{option_value}
    </label>
{/options:my_field_name} 

Now I have both the dropdown and checkboxes working perfectly.

T.

0

You'll have to use the default {field:my_field_name} for this.

I ran into the same problem trying the add checkboxes to a form. Turns out the field doesn't hold any data, because it is in fact still empty. You can write your own custom plugin to get that data or use field:my_field_name.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.