Hi, I have created a simple AJAX comment posting system. When a user clicks the submit button, everything works perfectly and the message is sent to the server then retrieved with formatted message list without reloading the whole page.
But the problem is when user uses the ENTER key from the keyboard instead of clicking the submit button, the whole page will be reloaded again. Here is the following code for the form:
<input type="hidden" name="parent_id" value="1" />
<input type="hidden" name="user" value="John" />
<input type="text" name="comment_text" value="" class="input_text" maxlength="50" />
<input type="button" name="submit" value="Quick Comment" class="submit" onclick="sendComment(); return false;"/>
So I would like to know if it is possible to let the enter key behave the same way when user clicks the submit button? If this is not possible, then is it possible to disable the ENTER key? Thank you.