Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use validate-digits-range validation in magento?

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

like image 424
Dhanapal Avatar asked Jan 30 '13 13:01

Dhanapal


2 Answers

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>  
like image 153
Paul Franke Avatar answered Oct 18 '22 19:10

Paul Franke


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.

like image 23
Péter Gulyás Avatar answered Oct 18 '22 17:10

Péter Gulyás