Jump to content

help with form.


MDanz

Recommended Posts

this is a 30 second submit button inbetween.  You have to wait 30 seconds to inbetween using it.

<html>
<head>
<script type='text/javascript'>
var doSomething = function(){
    var ele = document.getElementById("submitButton");
    if(ele.disabled){
        ele.disabled = false;
    }else{
        ele.disabled = true;
        setTimeout("doSomething()", 30000);
    }
}
</script>
</head>
<body>
<form enctype='multipart/form-data' action='insert.php' method='post' name='changer'>
<input type='button' onclick='doSomething();' id='submitButton' value='GO' />
</form>
</body>
</html>

 

It works. The problem i'm having is if i leave the page the time is lost.  So say i press the button, the timer starts, button unavailable. Then i go to another page and come back under 30 seconds.  The button is available to press.  How do i log the time?

Link to comment
https://forums.phpfreaks.com/topic/173763-help-with-form/
Share on other sites

In your other thread on this same problem it was pointed out that sessions/cookies can not be used because they are dependent on the browser, so the visitor has the ability to delete the piece of information that you are relying on.

 

Nothing you do in the browser with javascrpt will work either, for the same reason, you cannot control or rely on anything that the visitor does with his browser. You can only rely on what your server side scripting language is doing to detect and limit the time between submissions.

 

A lot of undesirable information that gets posted to pages comes from bot scripts anyway. There is no browser involved at all so attempting to use any method that is relying on how a browser works is going to be a waste of time.

Link to comment
https://forums.phpfreaks.com/topic/173763-help-with-form/#findComment-915974
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.