I have an input field and a login button. I want to allow users to hit the " enter" key to click the button when the input field is focused. How would I do this with jQuery? Home jQuery Enter key doing nothing on input field. Is it possible to make it work if it is clicked or the return key is used? jQuery Forum . Form data is sent via .post whenever the inputs are changed, so a submit button isnt needed. Please help me i dont understand that why the page is submitted on enter key in input field. my code isas per html form will trigger submit on hit of enter but if you want to prevent it with jquery you can prevent it by following code. Enter key on keyboard press when textbox in focus or button click. On every key-up we check for the Enter key.Id expect you could highlight a. jQuery setting input field value. I have a form to edit user and i would like to insert user data from database into forms fields. Is there a better way of doing this which would say, if enter pressed on . input1 do function?1Show ghosted example text in a field, and then clear it onblur. 1pass object in function parameter to clone in jquery. Enter Key makes form submission so easy that users always tend to use it. The easiest and the most intuitive way is that, the user can enter some text or make some changes toI am using simple jQuery and HTML form events.