i have php script to listen to a button that executes each second but i cant get the result of it because it keeps refreshing which i do not want my code for the button is below and the js timer, its simple code.
<form id="trigger">
<input type="submit" id="trigger" name="trigger" onclick="e()" value="click">
</form>
and this is the timer plus click;
<script>
setTimeout(function () {
document.getElementById("trigger").submit();
}, 1000);
Just don't do
document.getElementById("trigger").submit();
To get the value from some input box use:
document.getElementById('textbox_id').value;
and then you could pass the value on to your script using ajax.
If you want to emulate click use:
document.getElementById('trigger').click();
Your onclick function e() should return false to disable the submit process which will refresh the page.
Also, you should not use the same identifier for multiple things (you from and button are both "trigger").