performing via onsubmit not working?
See original GitHub issueIs it just me or is performing a task via an onsubmit
on a form not working? But an action that then calls perform works.
Does not work:
<form onsubmit={{perform createApp}}>
Works:
actions: {
createApp: function() {
this.get('createApp').perform();
}
}
<form {{action "createApp" on="submit"}}>
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
javascript onsubmit not working - Stack Overflow
My problem, I had without knowing a form inside a form I was interacting with the inner one no matter what I do...
Read more >Onsubmit not working! - JavaScript - SitePoint Forums
My onsubmit function is not working. My PHP file has two forms. Both form tags have an onsubmit attribute that links to the...
Read more >javascript - onsubmit is not working in form [SOLVED] - Daniweb
I want to validate my form so i call validateForm() using onsubmit of the form. It displays the alert but doesn't cancel the...
Read more >How to type a React form onSubmit handler
So we're telling TypeScript that event.currentTarget is an HTMLFormElement but then we immediately tell TypeScript that this isn't quite right by using as...
Read more >Onsubmit catalog client script not working properly - ServiceNow
Yeah that is because, the onsubmit cline script will only when there is a submit action performed on the portal. I would suggest...
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 FreeTop 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
Top GitHub Comments
Defining an
onsubmit
does not prevent the default behaviour from occurring. You’ll need to callevent.preventDefault()
to get this behaviour.Alternatively, just use
<form {{action (perform createApp) on='submit'}}>
which does preventDefault by default.Maybe add this to the FAQ? @machty Almost a year later and found this useful