I created a custom fieldset for a ui_component form to add custom input structures. The problem is, that the inputs are not included in the POST values.

enter image description here

The input you see is just a simple element in the fieldset.phtml you see in the Block code. It has a custom name "test_input_data". I implemented the fieldset similar to the conditions fieldsets on sales rules. The form namespance is shipping_rule_form.

<fieldset name="conditions" sortOrder="20">
        <label translate="true">Conditions</label>
    <container name="conditions_apply_to" sortOrder="10">
        <htmlContent name="html_content">
            <block name="conditions_apply_to" class="Company\Namespace\Block\Adminhtml\ShippingRule\Edit\Tab\Conditions" />

In the Block i am adding the fieldset like this:

protected function _prepareForm()
    $model = $this->_coreRegistry->registry('current_shipping_rule');
    $form = $this->addTabToForm($model);

    return parent::_prepareForm();

protected function addTabToForm($model, $fieldsetId = 'conditions_fieldset', $formName = 'shipping_rule_form')
    if (!$model) {
        $id = $this->getRequest()->getParam('entity_id');
        $model = $this->_ruleFactory->create();
    $conditionsFieldSetId = 'shipping_rule_form_conditions';

    /** @var \Magento\Framework\Data\Form $form */
    $form = $this->_formFactory->create();
    $renderer = $this->_rendererFieldset->setTemplate(

    $fieldset = $form->addFieldset(
            'legend' => __(
                'Apply the rule only to the products matched by the rule, if following conditions are met.'
            'name'           => 'conditions',
            'label'          => __('Conditions'),
            'title'          => __('Conditions'),
            'required'       => true,
            'data-form-part' => $formName

    return $form;

When i do a print_r() on the getParams() in the Save-Controller, it just returns the data of the corresponding model, but not the custom input value. I also tried to add the conditions exactly like in the sales_rule_form.xml, but still nothing is posted.

I could not find out how the submit logic works here and where i maybe missed or need to add logic.


1 Answer 1


I found the answer in this post: Magento 2 : Form Ui Component doesn't submit field in the html content

I needed to add the data-form-part="shipping_rule_form" to all the inputs.

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.