NG Absolute Form Validator - V14.0

CreditCard

The Credit Card rule checks that a field contains a properly formatted, plausible credit card number — the kind of validation you'd run on a checkout or payment form before ever sending the number to a payment processor. Card number checks of this kind typically verify the length falls within the range used by major networks (Visa, Mastercard, American Express, etc.) and that the digits pass the Luhn checksum algorithm, catching obvious typos early on the client side. Keep in mind this is a format check, not proof the card is active or has available funds — that verification still happens with your payment gateway.

#Directive Code Snippet
<!DOCTYPE html> 
<html lang="en"> 
    ...
    <form (ngSubmit)="onSubmit(form)" #form="ngForm">
		<input creditCard type="text" name="<name>" [(ngModel)]="<name>" #<name>="ngModel">
        <ng-absolute-validator [formInstance]="<name>"></ng-absolute-validator>
	</form>
    ...
</html>
#Chain Rule Code Snippet
<!DOCTYPE html> 
<html lang="en"> 
    ...
    <form (ngSubmit)="onSubmit(form)" #form="ngForm">
		<input [Rule]="credit_card" type="text" name="<name>" [(ngModel)]="<name>" #<name>="ngModel">
        <ng-absolute-validator [formInstance]="<name>"></ng-absolute-validator>
	</form>
    ...
</html>
#Reactive Form Code Snippet
//component.ts 
export class ReactiveComponent{

	public form  !: FormGroup;

  	constructor(
      	private fb : FormBuilder,
		private rv : ReactiveValidator,
	){this.generteForm()}

	generteForm(){
		this.form = this.fb.group({
			<name> : ['',this.rv.map('credit_card',<CUSTOM_MESSAGE>)],
		})
	}
}

//component.html 
<!DOCTYPE html> 
<html lang="en"> 
    ...
    <form [formGroup]="form">
		<input type="text" name="<name>" formControlName="<name>">
        <ng-absolute-validator [formInstance]="form.get(<name>)"></ng-absolute-validator>
	</form>
    ...
</html>