diff --git a/Form/Type/ChoiceWithOtherType.php b/Form/Type/ChoiceWithOtherType.php index 541f9cadb..6ef480ae0 100644 --- a/Form/Type/ChoiceWithOtherType.php +++ b/Form/Type/ChoiceWithOtherType.php @@ -19,7 +19,7 @@ class ChoiceWithOtherType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { //add an 'other' entry in choices array - $options['choices']['_other'] = '__other__'; + $options['choices']['_other'] = 'Other value'; //ChoiceWithOther must always be expanded $options['expanded'] = true; diff --git a/Resources/views/Form/fields.html.twig b/Resources/views/Form/fields.html.twig index 330d6c8f6..a097bc78f 100644 --- a/Resources/views/Form/fields.html.twig +++ b/Resources/views/Form/fields.html.twig @@ -95,13 +95,11 @@ jQuery(document).ready(initialize_{{ form.vars.id }}('ul_' + '{{ form.vars.id }} {% block choice_with_other_widget %}
- {%- for child in form.children._choices %} -{%- if child.vars.value == '_other' -%} -{{- form_widget(child) -}} {{- form_widget(form.children._other) -}} -{%- else -%} {{- form_widget(child) -}} {{- form_label(child) -}} +{%- if child.vars.value == '_other' -%} +{{- form_widget(form.children._other) -}} {%- endif -%} {% endfor -%}