Hi Friends I want to validate number range in magento. I also got validation class validate-digits-range. But i don't know to how to pass that minimum and maximum value for that validation. If anybody know means kindly share that example. Thanks in advance
How to use validate-digits-range validation in magento?
Asked Answered
Here's some docs for input validation in Magento 1.x inchoo.net/magento/out-of-the-box-form-validation-in-magento But they still don't tell you how to use validate-digits-range –
Anhydrous
You should use in text form field like :
... class="required-entry validate-digits-range digits-range-10-20"...
This will validate the value to be between 10 and 20.
See the following example for a range between 1 and 50: validate-number-range number-range-1-50
<field id="radius" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Delivery radius</label>
<validate>validate-number validate-number-range number-range-1-50</validate>
</field>
© 2022 - 2024 — McMap. All rights reserved.