I'm having trouble getting my JavaScript code to autofill credentials on a login webpage. Here's the code:
Can anyone spot what I'm doing wrong?
<!DOCTYPE html>
<html>
<body>
<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>
<script>
function Test() {
document.getElementById("usuario").value = "examplelogin";
document.getElementById("password").value = "examplepassword";
document.forms["formulario"].submit(); //form submission
}
</script>
</body>
</html>
Appreciate any assistance you can provide.