Form submitted twice on double click of button despite disable logic in place

Expected: the form should be submitted only once - we already have the ‘disable on form state executing’ logic in place on the button.

Actual: the form is submitted twice. although the first request is cancelled by the browser but the server side does indeed process both requests.

How to replicate: click the submit button twice real quick and you can see the form being submitted twice.

The code we’re using:

<div class="container">
		<div class="row" id="RowWithForm">
			<div class="col">
				<form id="form1" method="post" is="dmx-serverconnect-form" action="../dmxConnect/api/testdoubleclick.php">

					<button class="btn px-5 btn-danger" id="btnWithSpan" dmx-bind:disabled="state.executing" type="submit">Test Doubleclick with span
						<span class="spinner-border spinner-border-sm ml-2" role="status" dmx-show="state.executing">
						</span>
					</button>

				</form>
			</div>
		</div>
	</div>

please let us know if we’re doing something wrong here - or this is a bug!?

I am having the same issue. Although ‘disabled’ state is applied when server action is executed the mail can be sent more than once if the user just keeps clicking. For the records, the max repeated emails that were received were 4. Really quick user. Clicking faster than his shadow :slight_smile:

You may test following update:

dmxAppConnect.zip (22.3 KB)

1 Like

tested and confirm to be working well. BIG THANKS for a quick turnaround Patrick!

for our understanding: hadn’t seen this happening before - we have this setup of ‘form submit on button click with disable option’ across many forms in multiple projects. does this break because of some changes in chromium or otherwise?

Fixed in Wappler 3.5.3

This topic was automatically closed after 3 days. New replies are no longer allowed.