sbodak/magento2-checkout-custom-form

Magneto 2.2.6 - Mandatory field not working

gilbertsohal opened this issue · 2 comments

screenshot-2018 11 08-16-53-31
I’m working with latest ver 2.2.6 I have installed your extension successfully and its working great but I find one issue in that.

I have modify your extension and just using 1 field, the field i modify is 1st field which is mandatory but mandatory is not working anymore.

Could you please help me to sort out. I want to make this employee reference as mandatory field. Please find attached the screenshot.

For information I also try with your default extension but still any of the field not showing mandatory.

@sbodak Could you please check

I've updated my module and you can find a correct example of required value in a custom form component.

<item name="checkout_purchase_order_no" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Ui/js/form/element/abstract</item>
    <item name="config" xsi:type="array">
        <item name="customScope" xsi:type="string">customCheckoutForm</item>
        <item name="template" xsi:type="string">ui/form/field</item>
        <item name="elementTmpl" xsi:type="string">ui/form/element/input</item>
    </item>
    <item name="validation" xsi:type="array">
        <item name="required-entry" xsi:type="boolean">true</item>
    </item>
    <item name="provider" xsi:type="string">checkoutProvider</item>
    <item name="dataScope" xsi:type="string">customCheckoutForm.checkout_purchase_order_no</item>
    <item name="label" xsi:type="string">Purchase order no.</item>
    <item name="sortOrder" xsi:type="string">3</item>
</item>