This website version is not maintained anymore
Up to date documentation is available in Symfony 3.x website (see the dropdown menu above).
Use allowe_up
, allow_down
, allow_add
and allow_remove
options to disable some buttons
Warning: if you're using the plugin's form theme, allow_add
and allow_remove
are taken from your form type configuration.
Value :a
Value :b
Value :c
Value :a
Value :b
Value :c
Code used:
<!-- The name_prefix option is generated, please read at --> <script type="text/javascript"> function reloadCollectionButtons() { $('.form-collection').collection({ name_prefix: 'form[values]', allow_up: $('#up').is(':checked'), allow_down: $('#down').is(':checked'), allow_add: $('#add').is(':checked'), allow_remove: $('#remove').is(':checked'), allow_duplicate: $('#duplicate').is(':checked') }); $('.advancedForm-collection').collection({ name_prefix: 'advancedForm[values]', allow_up: $('#up').is(':checked'), allow_down: $('#down').is(':checked'), allow_add: $('#add').is(':checked'), allow_remove: $('#remove').is(':checked'), allow_duplicate: $('#duplicate').is(':checked') }); } reloadCollectionButtons(); $('.reload-collection').click(function() { reloadCollectionButtons(); }); </script>