dojox/validate/us.js

  • Provides:

    • dojox.validate.us
  • Requires:

    • dojox.validate._base in common
  • dojox.validate.us.isState

    • type
      Function
    • parameters:
      • value: (typeof String)
        A two character string
      • flags: (typeof Object)
        An object
        flags.allowTerritories  Allow Guam, Puerto Rico, etc.  Default is true.
        flags.allowMilitary  Allow military 'states', e.g. Armed Forces Europe (AE).  Default is true.
    • source: [view]
       var re = new RegExp("^" + dojox.validate.regexp.us.state(flags) + "$", "i");
       return re.test(value); // Boolean
    • summary
      Validates US state and territory abbreviations.
    • returns
      Boolean
  • dojox.validate.us.isPhoneNumber

    • type
      Function
    • parameters:
      • value: (typeof String)
        The telephone number string
    • source: [view]
       var flags = {
        format: [
         "###-###-####",
         "(###) ###-####",
         "(###) ### ####",
         "###.###.####",
         "###/###-####",
         "### ### ####",
         "###-###-#### x#???",
         "(###) ###-#### x#???",
         "(###) ### #### x#???",
         "###.###.#### x#???",
         "###/###-#### x#???",
         "### ### #### x#???",
         "##########"
        ]
       };
       return dojox.validate.isNumberFormat(value, flags); // Boolean
    • summary
      Validates 10 US digit phone number for several common formats
    • returns
      Boolean
  • dojox.validate.us.isSocialSecurityNumber

    • type
      Function
    • parameters:
      • value: (typeof String)
    • source: [view]
       var flags = {
        format: [
         "###-##-####",
         "### ## ####",
         "#########"
        ]
       };
       return dojox.validate.isNumberFormat(value, flags); // Boolean
    • summary
      Validates social security number
    • returns
      Boolean
  • dojox.validate.us.isZipCode

    • type
      Function
    • parameters:
      • value: (typeof String)
    • source: [view]
       var flags = {
        format: [
         "#####-####",
         "##### ####",
         "#########",
         "#####"
        ]
       };
       return dojox.validate.isNumberFormat(value, flags); // Boolean
    • summary
      Validates U.S. zip-code
    • returns
      Boolean
  • dojox.validate.us

    • type
      Object
    • summary
  • dojox.validate

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary