I have been using different script for auto submitting form like:
document.getElementsByTagName('form')[0].submit();
But all these refresh for endless time without submitting the form. I tried using alert
statement which worked fine but still the form was not submitted.
<form id="level" method="post">
<br/>
<label for="answer">Answer:</label>
<input type="text" name="answer" id="answer" />
<input type="submit" name="submit"开发者_JAVA技巧 id="submit" value="Submit" />
</form>
. With all your questions, I could try another conclusion. If you're trying to make a brute-force attempt to retrieve a password, the server could have identified your ip and just stall your request because you've tried too often. Or even notice you're inhumanly fast with your request. These kind of things are a base defense against brute-force attacks.
The code should work fine.
Another guess could be that the page actually does something different when clicking that button, in stead of the normal submit. So you could try simulating a click on the button in stead of submitting the form directy.
$('#submit').click();
that line of code is right, maybe it is DOM issue, there is another <form>
before or something else
you can try to access by ID
or jQuery :
$("#level").submit();
精彩评论