I am having a simple problem, I don't know how to address. I tried using g00gle but it didn't help much. I am designing a few "login" forms or even registration forms for a site of mine. I can login fine when I CLICK the login button. However, I know a lot of people, including myself, like to press the enter key on our keyboard to send the data. My problem is simple, when people use the enter key, and not click the button, the form posts ONLY the username, the password isn't even sent. The code is very simple, inside a <td> of a <table>: <form method="POST" action=""> <input onFocus="this.value=''" class="text1" type="text" name="username" value="Username"/> <input onFocus="this.value=''" class="text1" type="password" name="password" value="Password"/> <input type="submit" name="submit" value="Login"/> </form> Code (markup): This has happened on multiple sites of mine. I don't know if it's just my coding, or the browser, or both. I'd really appreciate help on that.
is the form being submitted to the right file ? try this : <form method="POST" action="USeyourformnamehere.php">
Maybe because your onFocus="this.value=''" deletes the value before submitting? Try this instead. onFocus="if (this.value == this.defaultValue) this.value = '';" Code (markup):