You can access the built-in method directly via
jQuery.validator.methods.creditcard. You have to provide two
arguments, the current value and the element to validate.

var element = $(...)[0];
if (jQuery.validator.methods.creditcard(element.value, element))
        // valid
else
        // invalid

Jörn

On Thu, May 15, 2008 at 4:14 PM, Gordon <[EMAIL PROTECTED]> wrote:
>
>  I want to extend the provided cxreditcard method to count a sequence
>  of * characters followed by 4 digits as a valid value. I need this for
>  a form where the credit card can be populated from a previously saved
>  value.  Naturally we don't want to display the full number for
>  security reasons but we need for the user to be able to see the last
>  four digits.
>
>  My idea was to write a new ccard method that calls the pre-existing
>  creditcard method.  If that method returns true then return true.  If
>  it returns false then check the field value against a regex /\*+[0-9]
>  {4,4}/.
>
>  How can I write a custom method that makes use of a built in
>  method?
>

Reply via email to