M
M
Max2016-02-26 20:21:25
Greasemonkey
Max, 2016-02-26 20:21:25

Greasemokey - submit login form. Why are only 2 out of 3 values ​​sent?

I'm trying to write a Greasemonkey script for autologin on rutracker.ru. Here is the form:

<form id="top-login-form" action="http://login.rutracker.org/forum/login.php" method="post" style="display: inline;">
<input id="top-login-uname" type="text" placeholder="имя" accesskey="l" tabindex="1" name="login_username">
<input id="top-login-pwd" type="password" placeholder="пароль" tabindex="2" name="login_password">
<input id="top-login-btn" type="submit" tabindex="3" value="вход" name="login">
</form>

And here is the script:
var f = document.getElementById("top-login-form");
f.elements.namedItem("login_username").value = "xxxxxx";
f.elements.namedItem("login_password").value = "yyyyyyy";
f.elements.namedItem("login").value = "%E2%F5%EE%E4";
f.submit();

When logging in manually, the Post request looks like this:
login_username=xxxxxxx&login_password=yyyyyyy&login=%E2%F5%EE%E4
When logging in using the script, only two of the three fields are sent, that is, the Post request looks like:
login_username=xxxxxxx&login_password=yyyyyyy
Please tell me why the login field is not sent, or with what tools can you try to track down what the problem is?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question