In this post I am going to explain how to add hidden field in ui_component form in Magento 2.
Check the below example code snippet to add hidden field in ui_component.
1 2 3 4 5 6 7 | <field name="id" formElement="hidden"> <argument name="data" xsi:type="array"> <item name="config" xsi:type="array"> <item name="dataType" xsi:type="string">text</item> </item> </argument> </field> |
Here formElement=”hidden” is used to create a hidden field.
If you want to check the UI component field then you can check it in Browser Console as its not visible in the form.
Thats it. Enjoy Magento 2!!
Write an article about ecommerce that help people to grow their ecommerce business. You’ll find best ecommerce guide, news, tips & more!
Leave a Reply