On Thu, Dec 31, 2009 at 6:33 AM, gazza <[email protected]> wrote: > Hello, > > I am trying to allow a user to enter credit card information i.e card > type,card number and expiration. > Are there any standard fields available to handle these common types? > > I was doing: > > ${.field("cardnumber", > h.text(name="cardnumber"), > required=True, > )} > > I can use the below, but its kinda lame as my son would say. > > Much appreciated any assistance on this.
There are three validators for credit card types in formencode.validators: - CreditCardValidator: checks that the card number is within the range for the specified CC company, and that it passes the checksum. - CreditCardExpires: checks that the expiration month & year is in the future. - CreditCardSecurityCode: checks that the card verification code has the correct number of digits for the specified CC company. You can add additional features to the form with Javasacript, but Pylons does not recommend a particular Javascript library because they change frequently and sometimes one is better and sometimes another. -- Mike Orr <[email protected]> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
