Prevent inserts into database within 5 seconds
I have a form that submits to a database.
Sometimes users inadvertanly click the submit button 2 or 3 times, resulting in 2 or 3 dupkicate submissions.
I would like to stop users from being able to insert any record within 5 seconds of the last insert
<cfquery datasource="#APPLICATION.ds#" name="get_max_ID">
SELECT MAX(insert_time) AS maxtime FROM FORMS
</cfquery>
When a form is submitted I need to check if it is within 5 seconds of the maxtime .
If it is . I <cfabort> with an error message.
If it is after 5 seconds I allow the insert.
How do I do this check?
