Magento 2 in checkout page postcode, I want to restrict alphabets allowed only numbers, how can I set by using a validation XML file?

I tried below link for postcode validation number

<item name="postcode" xsi:type="array">
     <!-- post-code field has custom UI component -->
     <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
     <item name="validation" xsi:type="array">
      <item name="required-entry" xsi:type="string">true</item>
      <item name="validate-number" xsi:type="number">0</item>

Please help me

  • @PrathapGunasekaran I have update my question have placed Already but not worked
    – Pawankumar
    Commented Mar 16, 2019 at 9:05
  • es onepage checkout i have place one page checkout file only
    – Pawankumar
    Commented Mar 16, 2019 at 9:31


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.