One for puzzles.
I want to disable the submit button to prevent duplicate submissions.
For this, I use jQuery:
jQuery('#subnewtopicform').on('submit', function () {
jQuery('#subnewtopic').prop('disabled', true);
});
And removed the HTML:
<form action="file.php" method="post" id="subnewtopicform">
<input type="text" name="title" />
<input type="submit" value="Submit" name="subnewtopic" id="subnewtopic" />
</form>
When you click the Submit button, it turns off and the page reloads, but the form does not submit properly, why ?! Removing jQuery code will lead to its correct presentation.
In my 10 years of coding, I have yet to meet something strange.
source
share