onSubmit submits form if handler function has error
See original GitHub issueI have <form #signInForm="ngForm" (ngSubmit)="onSubmit($event)">
whish is just basic sign in form, when error occurs in onSubmit
method it just submits the form. There’s no possibility of preventing default action at first as $event
is just null
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How do I disable form onsubmit if there is an error?
I'm using try/catch for error handling so when there is an error I do not want the window to close. <form onSubmit =...
Read more >.submit() | jQuery API Documentation
The submit event is sent to an element when the user is attempting to submit a form. It can only be attached to...
Read more >How to type a React form onSubmit handler
It's a bit verbose and distracts from the main purpose of the function; If I need to use that form anywhere else, I'll...
Read more >JavaScript Form Validation - The Art of Web
The purpose of a form validation script is to return a boolean value (true or false) to the onsubmit event handler. A value...
Read more >Batch validation
If any one validation fails, the dispatching function returns false to the onsubmit event handler, forcing it to evaluate to return false and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
http://prntscr.com/cpg2tl
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.