ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Safecracker multiple select

January 24, 2012 8:19pm

Subscribe [2]
  • #1 / Jan 24, 2012 8:19pm

    I haven’t been able to find an example of using Safecracker with a multiselect field that works for me.

    The following code…

    {exp:safecracker channel="reservations" error_handling="inline"}
    
            {services_requested}
                <label for="services_requested">Services Requested:</label>
                <select name="services_requested" id="services_requested" size="4" multiple="multiple">
                        {select_options}
                </select>
            {/services_requested}
    
        {/exp:safecracker}

    throws the following error:

    Fatal error: Call to a member function parse_type() on a non-object in D:\Sites\expressionengine.chasin-tails.ca\www\system\expressionengine\fieldtypes\multi_select\ft.multi_select.php on line 140

    My services_requested field is a standard EE Multi Select field.  Anyone have any idea what might be happening?  This is the syntax of the only Multi Select example I could find.

    Thanks!

  • #2 / Jan 24, 2012 8:27pm

    e-man

    1816 posts

    Hmm, the syntax mentioned in the docs at http://ellislab.com/expressionengine/user-guide/modules/safecracker/index.html#form-inputs is quite different:

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

    Maybe double-check?

  • #3 / Jan 25, 2012 12:39am

    Well, that works, but it isn’t a multi-select, it’s a single select drop down.  The example I was going by is here: http://ellislab.com/expressionengine/user-guide/modules/safecracker/examples.html

  • #4 / Jan 25, 2012 12:41am

    And never mind.  Once I added the “multiple” attribute, it was all good.  Thanks for getting me on the right track.

  • #5 / May 18, 2012 10:15am

    Eastwood Design

    605 posts

    I cannot get this to work in my safecracker publish form.
    my custom field is {connection}
    but my template is not parsing this field.  It shows this in the browser:

    {options:connection}{option_name} {/options:connection}

    On another note can I get a series of checkboxes in my form using a custom field multi-select?

    <INPUT NAME="options" TYPE="CHECKBOX" VALUE="o1">
      Option 1
    
    <INPUT NAME="options" TYPE="CHECKBOX" VALUE="o2">
      Option 2
    
    <INPUT NAME="options" TYPE="CHECKBOX" VALUE="o3">
      Option 3
    
    <INPUT NAME="options" TYPE="CHECKBOX" VALUE="o4">
      Option 4
    
    <INPUT NAME="options" TYPE="CHECKBOX" VALUE="o5">
      Option 5
    
    <INPUT NAME="options" TYPE="CHECKBOX" VALUE="o6">
      Option 6
    
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases