I am making a ajax login thing for my site but the code I have is not getting the values of the username + password.
Thats my login form.
Thats how I am including the login.js script
Is my login.js file
and when I click the login button this is what the alert says.
| Code: |
| echo '<table cellspacing="0"><form name="loginform" method="POST" onsubmit="lert(\'loading\'); login();return false;">
<tr><td><label>Username:</label></td> <td><input type="text" name="username" size="19" /></td></tr> <tr><td><label>Password:</label></td> <td><input type="password" name="password" size="19" /></td></tr> <tr><td align="center" colspan="2"><input type="submit" value="Login" /></td></tr></form> </table>'; |
Thats my login form.
| Code: |
| <script type="text/javascript" src="js/login.js"></script> |
Thats how I am including the login.js script
| Code: |
| function login(){
var username = document.loginform.username.value; var password = document.loginform.password.value; alert("Username: " + username + " Password: " + password) } |
Is my login.js file
and when I click the login button this is what the alert says.
| Quote: |
| Username: Password: |
