Can anyone provide insights on why the input credentials on a webpage cannot be autofilled with this code? Is there a solution to make it functional?
Trying to automate login process using JavaScript:
function Test() {
var name = document.getElementById("usuario").value;
var password = document.getElementById("password").value;
document.forms["formulario"].submit(); //form submission
}
<form id="formulario" name="formulario" method="post" target="_top" action="https://www.allianz.pt/area-privada">
<input id="usuario" name="_58_login" type="text" value="examplelogin" runat="server" />
<input id="password" name="_58_password" type="password" value="examplepassword" runat="server" />
<button onclick="Test()" id="btn">Submit</button>
</form>