@MasonBoom
Posted
Hello,
Although this is a very well done project, there is always room for improvement.
I noticed that the only required fields are the exp.date and the cvc. shouldn't all areas be required?
Also, I noticed I was able to add letters in the card number, cvc, and exp.date. You can fix this by adding the following code to those input tags in the html file:
type="tel" inputmode="numeric" pattern="[0-9]*"
This next part is optional, but you can also format the credit card number so it automatically adds a space every 4 digits by using this function:
const cardNumberFormat = (number) => { return number.replace(/(\d{4})/g, '$1 ').trim() }
Hope this helps!
@EseAlli
Posted
@MasonBoom thanks for the feedback