I have put auto click function on my form. I want to auto click submit button only once. But my code is continuously clicking on submit button. Due to that my page is continuously auto reloading.
I want to just click once on the button. How can I do that?
<form action="" method="POST">
<input type="text" size="80" name="url" value="https://drive.google.com/file/d/<?php echo $_GET['id']; ?>/view"/>
<input type="submit" id="btn" value="PLAY" name="submit" />
</form>
<script>
window.onload = function(){
document.getElementById('btn').click();
}
</script>