Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

Interactive Card Details Form With HTML,CSS,JS,JQuery

#jquery

@Tegarsetyo6

Desktop design screenshot for the Interactive card details form coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
2junior
View challenge

Design comparison


SolutionDesign

Solution retrospective


I still don't understand how to create the correction feature to stop form from submitting and show warning when form input is not appropriate

Community feedback

Simon Goellner• 40

@simeydotme

Posted

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 a onclick event on the <button>... then you can check if the form has not passed validation. You can return false or event.preventDefault inside of the checkValidation 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 helpful

0

@Tegarsetyo6

Posted

@simeydotme thank you very much for your help

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord