How to fill in form field, and submit, using javascript?
Solution 1:
document.getElementById('username').value="moo"
document.forms[0].submit()
Solution 2:
document.getElementById('username').value = 'foo';
document.getElementById('login_form').submit();
Solution 3:
You can try something like this:
<script type="text/javascript">
function simulateLogin(userName)
{
var userNameField = document.getElementById("username");
userNameField.value = userName;
var goButton = document.getElementById("go");
goButton.click();
}
simulateLogin("testUser");
</script>
Solution 4:
It would be something like:
document.getElementById("username").value="Username";
document.forms[0].submit()
Or similar edit: you guys are too fast ;)