2

I found this list validation rules:

Magento 2 - Form Validation

How to use above list of validation rules in uiForm-uiComponent. Can I add it inside xml <field> tag? or at least how to set required fields?

1 Answer 1

3

simple xml code for field required

<item name="validation" xsi:type="array">
    <item name="required-entry" xsi:type="boolean">true</item>
</item>

date validation

<item name="validation" xsi:type="array">
    <item name="validate-date" xsi:type="boolean">true</item>
</item>

validate-email

<item name="validation" xsi:type="array">
    <item name="validate-email" xsi:type="boolean">true</item>
</item>

for example look at

vendor/magento/module-cms/view/adminhtml/ui_component/cms_block_form.xml

0

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.