Categories

ep.validate.creditcard()

Categories: Utilities

ep.validate.url( value, [ options ] )

Plugin: ep.validate

Description: Validate a creditcard number.

  • ep.validate.url( value, [ options ] )

    version added: 6.11.0

    value   A text to validate

    options   A map of additional options pass to the method.

The ep.validate.creditcard() method checks if the givn string an valid creditcard number.

  • Validate a creditcard number.

    Code:
    ep.validate.creditcard( '4111111111111111' )
    
    Results:
    true
    
    
  • Validate a creditcard with error return.

    Code:
    ep.validate.creditcard( '4112334589700711' );
    
    Results:
    NO_CREDITCARD_NUMBER
    
    
  • required

    version added: 6.11.0

    A boolean indication wether the value is required.

    Default: false