Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Pretraži podršku

Izbjegni prevare podrške. Nikad te nećemo tražiti da nas nazoveš, da nam pošalješ telefonski broj ili da podijeliš osobne podatke. Prijavi sumnjive radnje pomoću opcije „Prijavi zlouporabu”.

Saznaj više

Form sometimes not submitting via JavaScript in Firefox only

  • Nema odgovora
  • 0 ima ovaj problem
  • 13 prikaza
more options

I apologize if this is not the best place, I didn't want to submit a bug report at this point because it could possibly be something on my side.

I work at a company where we use a mix of Firefox, Chrome, and Edge. I am a web developer and I have created a couple of web-based systems for my employer. In typical fashion, when a form is submitted, we use JavaScript to first verify the form as well as handle the submission. For the first three years or so, there were never any issues with any of the browsers.

The past two months or so, though, my Firefox users have been reporting problems as their forms will sometimes not submit.

Below is the final bit of code that performs the submission: if (formvalid) { console.log("test 1"); document.getElementById('mainForm').submit(); console.log("test 2"); document.getElementById('submitbutton').disabled = true; console.log("test 3"); }

It outputs test 1, test 2, test 3 to the console, so I know it has passed my verification and is reaching this part of the code. And the button with id "submitbutton" disables, but the form's submit() action does not get carried out.

If I manually re-enable the button from the console and press the button again, it submits properly in every test case so far.

I tested in my environment using Firefox, and initially it seemed to be working fine for me, but after about 20-30 tests, it did display the above behavior on my system, as well (I have tested to this extent and reproduced the situation about 5 times, just to ensure it wasn't a fluke). For my regular Firefox users, though, they run into the problem more often, maybe 5-10x times per week through typical usage. But it doesn't *usually* happen to them, just often enough to be a nuisance.

It does not output any errors to the console when it fails to submit.

What I've tried: switching order of disable action and submit action Button type of "button" vs. button type of "submit" inline onClick="" method vs. addEventListener document.getElementById('mainForm') vs. document.forms['mainForm'] adding a delay to prevent race conditions (although I don't think it really applies here)

All of the above had no noticeable impact.

We are all now on Windows 11, but this happened when ones of my users was still in Windows 10, so it seems unrelated to the OS version.

My Chrome and Edge users don't experience this behavior.

I should mention just in case there is any codebase difference as opposed to strictly localization, we are in an all-Japanese environment and use Firefox in Japanese.

I apologize if this is not the best place, I didn't want to submit a bug report at this point because it could possibly be something on my side. I work at a company where we use a mix of Firefox, Chrome, and Edge. I am a web developer and I have created a couple of web-based systems for my employer. In typical fashion, when a form is submitted, we use JavaScript to first verify the form as well as handle the submission. For the first three years or so, there were never any issues with any of the browsers. The past two months or so, though, my Firefox users have been reporting problems as their forms will sometimes not submit. Below is the final bit of code that performs the submission: if (formvalid) { console.log("test 1"); document.getElementById('mainForm').submit(); console.log("test 2"); document.getElementById('submitbutton').disabled = true; console.log("test 3"); } It outputs test 1, test 2, test 3 to the console, so I know it has passed my verification and is reaching this part of the code. And the button with id "submitbutton" disables, but the form's submit() action does not get carried out. If I manually re-enable the button from the console and press the button again, it submits properly in every test case so far. I tested in my environment using Firefox, and initially it seemed to be working fine for me, but after about 20-30 tests, it did display the above behavior on my system, as well (I have tested to this extent and reproduced the situation about 5 times, just to ensure it wasn't a fluke). For my regular Firefox users, though, they run into the problem more often, maybe 5-10x times per week through typical usage. But it doesn't *usually* happen to them, just often enough to be a nuisance. It does not output any errors to the console when it fails to submit. What I've tried: switching order of disable action and submit action Button type of "button" vs. button type of "submit" inline onClick="" method vs. addEventListener document.getElementById('mainForm') vs. document.forms['mainForm'] adding a delay to prevent race conditions (although I don't think it really applies here) All of the above had no noticeable impact. We are all now on Windows 11, but this happened when ones of my users was still in Windows 10, so it seems unrelated to the OS version. My Chrome and Edge users don't experience this behavior. I should mention just in case there is any codebase difference as opposed to strictly localization, we are in an all-Japanese environment and use Firefox in Japanese.

Za odgovaranje na poruke moraš se prijaviti na tvoj račun. Postavi novo pitanje, ako još nemaš račun.