I'm using the jQuery Validation Engine with this file of translations into Portuguese. I have added the following line to the JavaScript:
"cnpj": {
"regex": /^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$/,
"alertText": "* CNPJ inválido"
}
In ASPX I use:
asp:TextBox ID="txtCNPJ" runat="server" CssClass="validate[required,custom[cnpj]]
But this validation is not very efficient, since it only checks the number of characters.
How can I make a method to validate the CNPJ and continue using the Validation Engine in this way?