1. Using PHP
In the controller, Insert the current date and time into the
If the user clicks on the submit button the first time set the
cookie and the second time check
cookie is set or not.
cookie sets and compares the
current date time with the
cookie date time is greater than 2 minus the perform the action otherwise returns an error message.
2. Using jQuery
Logic same as PHP controller. In jQuery use localStorage to set current data and time for the compare.
Set current date into localStorage
var currentTime = new Date();
Get date from localStorage
var get_date = localStorage.getItem('storage');
Compare the current date and storage date to write your logic.
If the condition is not fulfilled, Disable the submit button.