Is integer an age value input - Node.js Number

Node.js examples for Number:Int

Description

Is integer an age value input

Demo Code

       age : {/*  ww  w.  ja va 2s. c o  m*/
          validator : function(value) { 
              return /^(?:[1-9][0-9]?|1[01][0-9]|120)$/i.test(value); 
          }, 
          message : 'age is integer from 0 to 120' 
       },

Related Tutorials