TIWCGJQCreditCardValidatorOptions.OnValidate Property
The event is called in the validation of credit card.
Receive three parameters in "AParams":
- ccname - one of the strings ['amex','diners_club_carte_blanche','diners_club_international','m astercard','discover','jcb','laser', 'maestro','visa','visa_electron'], eg visa
- validlength - true if the number length is valid, false otherwise
- validluhn - true if the Luhn checksum is correct, false otherwise
published property OnValidate: TIWCGJSonFunc index 01 read GetFuncValue write SetFuncValue stored IsFuncStored;
![]() |
---|
To work the credit card validator, you need this event assigned! |
procedure TIWForm1.IWCGJQCreditCardValidator1JQCreditCardValidatorOptionsValidate(Sender: TObject; AParams: TStringList); var ccName: string; ccValidLength: Boolean; ccValidLuhn: Boolean; begin ccName:= AParams.Values['ccname']; ccValidLength:= StrToBool(AParams.Values['validlength']); ccValidLuhn:= StrToBool(AParams.Values['validluhn']); if ccValidLength and ccValidLuhn then WebApplication.ShowMessage('Valid Credit Card Number - ' + ccName); end;