@@ -447,7 +447,7 @@ The type would now look like::
447447 class SportMeetupType extends AbstractType
448448 {
449449 public function buildForm(FormBuilderInterface $builder, array $options): void
450- {
450+ {
451451 $builder
452452 ->add('sport', EntityType::class, [
453453 'class' => Sport::class,
@@ -488,7 +488,7 @@ The type would now look like::
488488 }
489489 );
490490
491- // by default, action does not appear in the form tag
491+ // by default, action does not appear in the < form> tag
492492 // you can set this value by passing the controller route
493493 $builder->setAction($options['action']);
494494 }
@@ -546,7 +546,7 @@ field according to the current selection in the ``sport`` field:
546546.. code-block :: html+twig
547547
548548 {# templates/meetup/create.html.twig #}
549- {{ form_start(form, { ' attr' : { 'id' : 'supply_history_form' } }) }}
549+ {{ form_start(form, { attr: { id : 'supply_history_form' } }) }}
550550 {{ form_row(form.sport) }} {# <select id="meetup_sport" ... #}
551551 {{ form_row(form.position) }} {# <select id="meetup_position" ... #}
552552 {# ... #}
@@ -568,19 +568,22 @@ field according to the current selection in the ``sport`` field:
568568 });
569569
570570 const text = await req.text();
571+
571572 return text;
572573 };
573574
574575 const parseTextToHtml = (text) => {
575576 const parser = new DOMParser();
576577 const html = parser.parseFromString(text, 'text/html');
578+
577579 return html;
578580 };
579581
580582 const changeOptions = async (e) => {
581583 const requestBody = e.target.getAttribute('name') + '=' + e.target.value;
582584 const updateFormResponse = await updateForm(requestBody, form.getAttribute('action'), form.getAttribute('method'));
583585 const html = parseTextToHtml(updateFormResponse);
586+
584587 const new_form_select_position = html.getElementById('meetup_position');
585588 form_select_position.innerHTML = new_form_select_position.innerHTML;
586589 };
0 commit comments