Functiondojox.validate.isNumberFormat

dojo.require("dojox.validate._base");
defined in dojox/validate/_base.js

Use it for phone numbers, social security numbers, zip-codes, etc. The value can be validated against one format or one of multiple formats.

Format

Stands for a digit, 0-9.

? Stands for an optional digit, 0-9 or nothing. All other characters must appear literally in the expression.

Example "(###) ###-####" -> (510) 542-9742 "(###) ###-#### x#???" -> (510) 542-9742 x153 "###-##-####" -> 506-82-1089 i.e. social security number "#####-####" -> 98225-1649 i.e. zip code

Usage

function (/*String*/ value, /*Object?*/ flags) (view source)
parametertypedescription
valueStringA string
flagsObjectOptional. format A string or an Array of strings for multiple formats.