hi!
you can do the javascript validations for purely front-end checkings such as empty fields,number of digits , etc.
as far as business logic is concerned, you can have a business method as suggested by maulin earlier to check for the presence of card number and other details.