public function postSubmit(FormEvent $event)
    {
        // Suppress validation
        $event->stopPropagation();

        $constraints = [];
        $attributes['class'] = 'js-change-urlchooser';

        $form = $event->getForm()->getParent();
        $linkType = $event->getData();

        if ($linkType) {
            $form->remove('link_url');

            switch ($linkType) {
                case URLChooserType::INTERNAL:
                    $attributes['choose_url'] = true;

                    break;
                case URLChooserType::EXTERNAL:
                    $attributes['placeholder'] = 'https://';
                    $constraints[] = new Url();

                    break;
                case URLChooserType::EMAIL:
                    $constraints[] = new Email();

                    break;
            }

            $form->add('link_url', TextType::class, array(
                'label' => 'URL',
                'required' => true,
                'attr' => $attributes,
                'constraints' => $constraints,
                'error_bubbling' => true,
            ));
        }
    }