3
I made a form, and before sending I check if the person typed the user and password. I put this in the event submit
, but it doesn’t seem to work.
The code:
<script>
subimitar = function(){
if(document.getElementByName("usuario").value == ""
||
document.getElementByName("usuario").senha == ""
){
alert("você tem que digitar os campos usuario e senha")
return false;
}
}
</script>
The html:
<form action="/" method="post" onsubmit="subimitar()">
Usuario
<input type="text" name="usuario"/>
Senha
<input type="text" name="senha"/>
<input type="submit" value="entrar"/>
</form>