Duplicate submission on custom form


(Sang) #1

Matrix Version: 5.5.1.3

Hi,

Is there any way to check if a user submitted a custom form with the same data?
Some inpatient users submitted the form and do the submission again if they do not get a response quickly.

I do not think using Cookie is the best way because the PC can be shared by random people.

Thanks in advance


(Tbaatar) #2

You could disable the submit button with JS when submitted?


(Sang) #3

The problem is how to check if there is a submission with the same data from previous submissions. If we can find out then we can disable submit button with js


(John gill) #4

I don’t think it would be possible to safely do this check at submission time because it would mean that the user submitting the form would need read access to all the other submissions. Any kind of awareness of previous submissions at that point is potentially a security issue.

The de-duplication needs to be done either when the submissions are being processed (when they’re exported, or by the system that they get sent to), or in the browser as @tbaatar suggested.


(Tbaatar) #5

Potentially you can check localStorage data and compare it against the form that is being sent. If it doesn’t match the button is enabled to send, and sent data is stored in the localStorage.

Comparing textarea might be overkill, so it will only work with something like name, the reason for contact + timestamp.

Never tried something like this therefore it might not be possible and there could be GDPR issues.


(Hugh McMaster) #6

Do you mean they are submitting after a short time, or do the duplicates appear almost immediately?

If it’s the latter, I recall that being a Matrix bug.