0

I am trying to force the user to use numbers in the field limiting them to 9 numbers (no more and no less). I've found that that the XML file path for the checkout page is *\vendor\magento\module-checkout\view\frontend\layout\checkout_index_index.xml and the code related to the phone is as follows:

 <item name="min_text_length" xsi:type="number">11</item>
 <item name="max_text_length" xsi:type="number">11</item>
 <item name="validate-number" xsi:type="number">1</item>

And now i want to add a validation similar to the min_max_length that would refuse to accept any further input past 9 numbers

2
  • Have you seen this magento.stackexchange.com/a/150984/70343 Jun 10 '20 at 21:04
  • @DominicXigen Thank you for responding, Yes, i checked this yesterday but i wanted to rule out the possibility that it cant be done from WITHIN the xml file. If said possibility is ruled out then ill repost my question asking for clarification on how i can do it using JS because most Q&As are working with older version of magento (im currently using 2.3.5). Do you have any idea if it can be done from within the XML like "min_text_length"?
    – Zyzzx
    Jun 11 '20 at 7:45

Your Answer

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

Browse other questions tagged or ask your own question.