touchpoints icon indicating copy to clipboard operation
touchpoints copied to clipboard

Multiple responses can’t be submitted via modal because success message isn’t cleared.

Open adunkman opened this issue 1 year ago • 3 comments

We’re in the process of implementing Touchpoints using a custom styled button in the 18F Guides (https://github.com/18F/guides/pull/723). Through testing, we’ve noticed that a user can’t submit multiple responses to the same page — the second time the modal is activated, the success message is still displayed rather than the form.

Here’s a quick demo:

https://github.com/user-attachments/assets/456bf684-5830-46a9-9e99-70987b6dd9b1

Ideally, we’d like to allow our users to submit multiple comments.

adunkman avatar Sep 26 '24 15:09 adunkman

The confirmation message stays to discourage a user submitting multiple comments on a given page. This is often exploited by bots and scripts.

Refreshing the page renews the form. Not inclined to change this behavior, as users requested this a few months ago.

Can you share a bit more about your use case and why a user submitting multiple comments on a single page experience is desirable?

ryanwoldatwork avatar Sep 26 '24 17:09 ryanwoldatwork

Sure!

We often have longer pages of content on guides, and I’d like to encourage folks to provide feedback as they read.

adunkman avatar Sep 26 '24 17:09 adunkman

@adunkman,

Something like this can be used

document.addEventListener('onTouchpointsModalOpen', function() {
	if (window.touchpointForm12345.isFormSubmitted) {
		window.touchpointForm12345.resetFormDisplay();
	}
})

This will reset a single page form when the modal is opened, if it has already been submitted successfully.

ryanwoldatwork avatar Apr 08 '25 19:04 ryanwoldatwork