I have this code in my safecracker form

<select class="span2" data-title="Help" data-placement="right" data-trigger="focus" data-content="{instructions:gender}" disabled id="gender">
   <option value="{option_value}" {selected}>{option_name}</option>

genders is a relationship field. According to the documentation, I should be able to generate options for a select field using this syntax

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

This doesn't work for me.

However, using


works but outputs a select dropdown. I don't want this since I want to specify some attributes for the select tag as you can see above.

Any idea why this is the case?

I am using EE 2.5.5


1 Answer 1


You can try like this code example:

    {if relationship AND field_name == 'gender'}
        <select id="{field_name}" name="{field_name}[data][]">
                <option value="{option_value}"{selected}>{option_name}</option>

I hope, it would work for you.

  • In my case, I don't think I need [data][]. I got an error. So I removed and it worked for me. Jul 16, 2013 at 8:17
  • glad to know it. Jul 16, 2013 at 8:27

Your Answer

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

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