How must I populate a playa hidden input field (in a safecracker form) with multiple entries? I tried passing the entry IDs separated by comma, semicolon, bar, but nothing seems to work. Only the first entry in the array gets saved. How do I have to format the entry IDs for multiple relationships to be saved? 

Update: Thanks to Jeremy I now know how to add data to Playa correctly. Alas, it's still not working, now I get PHP errors. 

This is what I have (inside a safecracker form):

 {exp:channel:entries channel="channel-name" category="{category\_id}" dynamic="no" disable="member\_data|pagination"}
 - {title}{if {embed:parent\_id} == '{exp:playa:parent\_ids}' }
 {if:else}
 {/if}

 {/exp:channel:entries}

I make a list with checkboxes. The conditionals check whether this entry is related to the entry currently being edited. So when it's related 

```
<input class="relate" type="hidden" name="playa_field[selections][]" value="{entry_id}"/>

```

gets displayed, when it's not related 

```
<input class="relate" type="hidden" name="0" value="{entry_id}"/>{/if}</label>

```

gets displayed. This works fine. 

In the footer I load jQuery and this code to look for changes on checkboxes. When a checkbox is changed the "name" attribute gets updated. 

```
    $(document).ready(function() {
        var $checkboxes = jQuery("#tag_list").find(":checkbox");
        $checkboxes.on('change', function () {
            var $relate = jQuery(this).siblings('.relate').attr("name"),
            $name = "playa_field[selections][]";
            if ($relate == $name) {
                jQuery(this).siblings('.relate').attr( "name", "0" );
            }
            if ($relate != $name) {
                jQuery(this).siblings('.relate').attr( "name", "playa_field[selections][]" );
            }
        });
    });

```

This also seems to work, I can see the "name" attribute get changed in the Safari developer tools. 

But now, when I submit the field I get a bunch of the following PHP errors:

```
Severity: Warning

Message: array_filter() expects parameter 1 to be array, string given

Filename: playa/ft.playa.php

Line Number: 2356

Severity: Warning

Message: array_merge() [function.array-merge]: Argument #1 is not an array

Filename: playa/ft.playa.php

Line Number: 2356

```

What am I doing wrong?
['https://expressionengine.stackexchange.com/questions/14001', 'https://expressionengine.stackexchange.com', 'https://expressionengine.stackexchange.com/users/779/']
You'll want to actually use multiple hidden fields, each adding to an array:

```
<input type="hidden" name="cf_playa_field[selections][]" value="123">
<input type="hidden" name="cf_playa_field[selections][]" value="456">

```

You could also potentially write an extension to rework the POST data if you absolutely must submit the values in one field.
OK, I got this squared away. It seems like my name="0" inputs were causing the errors. Now I remove the complete hidden input when a checkbox is unchecked and create a new one on the fly when a checkbox is checked.