Working with E-Mail and Credit Cards in Validator Framework

Working with E-Mail and Credit Cards in Validator Framework

Previous Home Next

 

In this chapter,We will discuss working of E-Mail and Credit Cards in Validator Framework.The email validator employs an extensive check of the format of a prospective email address to be sure it is in accordance with the published specification and creditCard validator analyzes the value to see if it could be a credit card number.Credit card numbers include a parity-check digit

 E-Mail and Credit Cards both routines are converted from working routines that were used by java script and perl developers,respectively.Ted Husted translated  these routines to java and added them to the validator framework.

Credit card  validator :- This validator validate credit card number format.Credit card numbers include a parity-check digit. The validation checks for this digit and other business rules

Example:-

<field property="creditCard"    depends="required,creditCard">  
<arg0 key="customer.cardnumbee"/>
</field>
<field property="creditCard" depends="required,creditCard">  
<arg0 key="customer.cardnumbee"/>
</field>

E-Mail validator :-This validator validate email address format.

Example :-

<field property="email" depends="required,email">	
<msg name="required" key="err.user.email.required" />
<msg name="email" key="err.user.email.invalid" />	 
</field>

Previous Home Next