I’m having problems with getting a login box I made to hide. Here is the HTML code I use to make the login box:
<center>
<form name=login>
<table width=225 border=1 cellpadding=3>
<tr><td colspan=2><center><font size="+2"><b>Login</b></font></center></td></tr>
<tr><td>Username:</td><td><input type=text name=username></td></tr>
<tr><td>Password:</td><td><input type=password name=password></td></tr>
<tr><td colspan=2 align=center>
<button type="button" onclick="loginNow()">Login</button>
</td></tr>
</table>
</form>
</center>
When the “Login” button is clicked, it runs some Javascript code. The loginNow() function runs, which verifies the password. Once the password is verified, I need this form to hide.
Can anyone give me some code that will work in this situation?
Wrap your form in a div with an id:
Then, in the
loginNow()function, usedocument.getElementById('loginform').style.visibility = 'hidden'