How to use validate-digits-range validation in magento?
Asked Answered
P

2

12

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

Patrilineage answered 30/1, 2013 at 13:2 Comment(1)
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-rangeAnhydrous
S
23

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.

Squelch answered 30/1, 2013 at 15:18 Comment(0)
D
1

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>  
District answered 3/5, 2021 at 19:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.