Frontend Developer from the 2000s, fighting tooth-and-nail to stay relevant! Lots of experience in Usability, UX and Frontend UI Development for the Web. Joined up to help mentoring some Juniors I know.
I’m currently learning...VueJS, SvelteJS, Sveltekit, Storybook, Blender3d
Latest solutions
Latest comments
- @Tegarsetyo6Submitted over 2 years ago@simeydotmePosted over 2 years ago
To prevent the form from submitting if Validation is not passed, you may use an
onsubmit
event on the<form>
element (<form onsubmit='checkValidation'>
) instead of using aonclick
event on the<button>
... then you can check if the form has not passed validation. You canreturn false
orevent.preventDefault
inside of thecheckValidation
event handler to stop the form from submitting on error.More information can be found on mozdev; https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/submit_event#javascript
Hope that is helpful!
Marked as helpful0 - @CharmaineHYMSubmitted over 2 years ago@simeydotmePosted over 2 years ago
You could consider setting a "pattern" attribute and "inputmode" attribute on the card number <input> so that it allows easier input on mobile devices :)
Aside from that the thing looks great! Good job! You've followed the design very well and the mobile view looks perfect!
0