Specifically in this form, for example 1 dispatch in 30 minutes. Thank!

$(document).ready(function() { //E-mail Ajax Send $("form").submit(function() { var th = $(this); $.ajax({ type: "POST", url: "mail.php", data: th.serialize() }).done(function() { alert("Бпасибо! ΠœΡ‹ свяТСмся с Π’Π°ΠΌΠΈ Π² блиТайшСС врСмя."); setTimeout(function() { // Done Functions th.trigger("reset"); }, 1000); }); return false; }); }); 
  • one
    In general, it is more correct to do this on the backend side, since any restrictions on the frontend are easy to manage. But if it is fundamentally for it to be on the frontend, now I will write a solution. - Dmitry Miroshnichenko
  • I'm still not strong at all in any development, I study, therefore I need something from the β€œsimple”) - Serj

1 answer 1

When sending, you can record the time of the last form sent, and then check the next 30 minutes or not at the next check.

 $(document).ready(function () { //E-mail Ajax Send $("form").submit(function () { if (localStorage.getItem('lastSend') && new Date().getTime() - localStorage.getItem('lastSend') < 30 * 60 * 1000){ return false; } var th = $(this); $.ajax({ type: "POST", url: "mail.php", data: th.serialize() }).done(function () { alert("Бпасибо! ΠœΡ‹ свяТСмся с Π’Π°ΠΌΠΈ Π² блиТайшСС врСмя."); localStorage.setItem('lastSend', new Date().getTime()); setTimeout(function () { // Done Functions th.trigger("reset"); }, 1000); }); return false; }); }); 
  • Thank you, set bye 10 minutes) - Serj