I am developing a module using ui_form. I have developed ui_form and on submit it post all fields except custom html fields.

For example:

<container name="pl_labelposition" >
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">30</item>
                <item name="label" xsi:type="string" translate="true">Label Position</item>
        <htmlContent name="html_content">
            <argument name="block" xsi:type="object">Company\Module\Block\Adminhtml\ProductLabel\Edit\LabelPosition</argument>

I also use conditions of sales rules:

        <container name="conditions_apply_to" >
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">10</item>

        <htmlContent name="html_content">
            <argument name="block" xsi:type="object">Magento\SalesRule\Block\Adminhtml\Promo\Quote\Edit\Tab\Conditions</argument>

Could you help me to resolve this problem? I am not able to submit such fields to controller. How can i use in controller?

Help will be appreciated

Thank You in Advance


In your block create

protected $_template = 'Company_Module::labelposition.phtml';

now, make labelposition.phtml and add your html field with attribute data-form-part="formname".

Here the formname must be name of your uiform like <uiComponent name="product_form"/>.


<input type="text" data-form-part="product_form" name="test" value="Hello World">

You will get the value of this field.

  • Thanks for explanation. It works. I was just missing data-form-part attribute. Aug 19 '17 at 10:29
  • great to know that it helped you. your welcome Aug 19 '17 at 10:30
  • With e.g <input type="checkbox" data-form-part="product_form" name="test[]" value="Hello World"> <input type="checkbox" data-form-part="product_form" name="test[]" value="Hello World Two">. it not submit true.
    – xanka
    Nov 7 '17 at 7:27
  • nice answer. worked perfectly.
    – Yau Thomas
    Jan 2 '18 at 7:17
  • glad to know it... Jan 8 '18 at 16:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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