Hi all,
I have form which user must fill on monthly basis.
please advice how to set a rule which will prevent the user to send the form if filled data exists in answered table (fill date time field exist)
any solution would be appreciated.
Hi all,
I have form which user must fill on monthly basis.
please advice how to set a rule which will prevent the user to send the form if filled data exists in answered table (fill date time field exist)
any solution would be appreciated.
Hello,
When submitting the form you can check if the NOW
variable in Server Connect is >= 30 days than the value stored in the database.
Then > show an alert and don’t submit
Else > submit the form
Hi @Teodor,
thank you for quick reply, where should go for creating this rule?
within form section-dynamic events --> server connect --> forbidden?
or i should create a new server connect with connection to new server action that is loading data from stored answers table ?
right now the only connection to stored answers table is within inser server action
You’re probably best doing this on the client-side rather than the server (but you might want to add a condition there too depending on if someone wanted to manipulate data, would it be a security/integrity issue)
On the client-side,
Add a date and time element to the page (in this example mine is id var1)
Then use a server connect to retrieve the last date
You could disable the form’s submit button by using dynamic attributes and compare to the date (in code view for the button add dmx-disabled = serverconnectfordate.data.lastdate > var1.datetime.addDays(-30) ? 'disabled' : ''
)
and/or use a dynamic event on the button to submit the form (change the type from ‘submit’ to Default) after checking the date. It’s really easy to use an inline flow to achieve this.