In magento 2 What I need to use instead of "after_element_html". In magento2 form structure is in xml format, then how do I give note for a particular field in form ? Please provide me a solution

  • Have you found answer ? Commented Nov 21, 2018 at 12:25
  • Not yet, Because it is a ui component form so failed to add content dynamically
    – Jaisa
    Commented Nov 22, 2018 at 14:26

2 Answers 2


This is something if you want to add after the field element you are adding in admin form

You can added whatever you want html, javascript code, css

  • I need to set dynamic data for a particular field in admin form in magento 2
    – Jaisa
    Commented Jan 17, 2018 at 13:11
$form = $this->_formFactory->create();

        $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Widget')]);

                'label' => __('Widget Type'),
                'title' => __('Widget Type'),
                'name' => 'widget_type',
                'required' => true,
                'onchange' => "wWidget.validateField()",
                'options' => $this->_getWidgetSelectOptions(),
                'after_element_html' => $this->_getWidgetSelectAfterHtml()


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.