Menu

Stop Calling form.submit(). Use requestSubmit() Instead.
📰

Stop Calling form.submit(). Use requestSubmit() Instead.

DEV Community: html·Parsa J·20 days ago
#VDvDb1xw
#devto2#devto#dev#submit#form
Reading 0:00
15s threshold

The bug report said "the modal saves blank data sometimes." Not always — just sometimes, and only for one field: the user's email. QA could reproduce it maybe one click in five, and only if they clicked Save fast, before the field had a chance to go red.

Here's the part that should have been impossible: the input had required on it. HTML form validation is supposed to catch an empty required field before anything goes anywhere. And yet, once in a while, it didn't — the page would flash white for a quarter second, like it had just reloaded, and the record would land in the database with an empty string where the email should be.

It had reloaded.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.