3 ms·
I dunno. Why would you even try to use onclick instead of onsubmit. You’ll need to capture return keys, handle accessibility etc etc etc. It’s simply not the ri
by jbverschoor 5y ago
I dunno. Why would you even try to use onclick instead of onsubmit. You’ll need to capture return keys, handle accessibility etc etc etc. It’s simply not the right thing to do.
Also. Onclick will simply execute the content as JavaScript. So if you’re not passing an argument, why would you expect an argument?
You can simply return false to prevent the defaults from happening.
The whole article has nothing to do with a rabbit hole. But more with a junior dev
- idkwhoiam 5y agoHe could also use FormData [1] to collect values from the form [1] - https://developer.mozilla.org/en-US/docs/Web/API/FormData/FormData https://developer.mozilla.org/en-US/docs/Web/API/FormData/Fo...
- eatonphil 5y ago> Why would you even try to use onclick instead of onsubmit I mentioned in the post I switched to onsubmit. > But more with a junior dev Damn, anyone can be a junior dev these days! :)