Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Well, actually, on second thought, the problem is that there isn't a click to that button whenever the uses presses enter. What I need is to somehow catch the event when the user presses enter from the textfield. Commented Oct 31, 2011 at 22:20
  • Hmm the point is, by default behavior submit buttons in a form, submits the form automatically by pressing Enter on any text field. But the rule is not valid for normal buttons. You can submit your form manually. Commented Oct 31, 2011 at 22:26
  • 1
    Btw, submit button is more semantic in a form rather than normal button. If you want to use it, you can simply prevent default behavior by event.preventDefault() Commented Oct 31, 2011 at 22:28