Created
June 8, 2017 16:23
-
-
Save bluepnume/fb4bf3b992e0d6d23eeecd4693690032 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a form with: | |
// * A text field for a credit card number | |
// * A button to submit the credit card | |
// | |
// Requirements: | |
// | |
// - The page should do some client side validation, and only allow credit card numbers which are: | |
// * 16 digits long | |
// * Only contain numbers, spaces, or dashes | |
// | |
// - If the validation fails, the page should show an error message next to the form field | |
// - If the validation succeeds, the page should make an ajax call to /api/credit-card/validate with the number to do server-side validation | |
// - The page should then show a success message, or a validation error | |
// | |
// Bonus: | |
// | |
// - Make the client/server validation happen as the user types |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment