I have a form and I wanted the form to be loaded when the page was loaded. I'm using the code below, however it gets in an infinite loop.
<form name="teste" action="inicial" method="post">
Nome do Usuário: <input type="text" name="user">
<input type="submit" value="Enviar">
</form>
JS
$(document).ready(function () {
window.onload = function() {
document.forms[0].submit();
}
});
When I load the page, it submits infinitely. I thought I would run only once.