I have this form into PHP pages:
echo "<form action=\"xxx.php\" method=\"post\" id=\"test\" name=\"test\">
<input type=\"submit\" name=\"oooo\" value=\"Sincronizza\">
</form>";
On top I have this JavaScript for automatic submit:
<script type='text/javascript'>
<!--
function send() {
var objForm = document.getElementById('test');
objForm.action='xxx.php';
objForm.submit();
}
window.setTimeout('send()', 5000)
//-->
</script>
Unfortunately, the script start an refresh page and not an auto-submitting.
What is the problem?
Using JavaScript to submit, the value of the submit-input tag is not posted. A solution could be to include a hidden type input in the form: