How to limit current user to only submit a form once on the current day

There are similar posts to this but none directly ask or answer this question ( that i have found anyway) I have even tried hiring a Wix expert but no reply so i am hoping i get some luck here…

I have a form linking to a dataset where users submit, I want to disable the submit button if the current user has already submitted on the current day. There seems to be many ways to do this but i am thinking if i auto fill the fields “email address” and “date” on the form and make them read only (so they can’t be changed) then i can run a query to look up these 2 fields and disable the button if any results are returned? This may sound simple to some but I have been stuck on this for a while now and would really appreciate any help i can get.

Thanks in advance

Matt

Hi Matt.

You can add an input field for email to your form, then add an onChange event to the input field. Inside the onChange event add code to query your database for the email. If the email is present, check for the created date and if it’s same day display an error message, else proceed with form submission. You can see the isSameDay helper function in step 14f here .

Good luck!