Questions tagged [enter]

The ENTER/RETURN key on the keyboard.

On computer keyboards, the enter key in most cases causes a command line, window form, or dialog box to operate its default function. This is typically to finish an "entry" and begin the desired process, and is usually an alternative to pressing an OK button.

Source

Wikipedia

882 questions
826
votes
19 answers

How can I detect pressing Enter on the keyboard using jQuery?

I would like to detect whether the user has pressed Enter using jQuery. How is this possible? Does it require a plugin? It looks like I need to use the keypress() method. Are there browser issues with that command - like are there any browser…
chris
  • 20,791
  • 29
  • 77
  • 90
380
votes
20 answers

Prevent form submission on Enter key press

I have a form with two text boxes, one select drop down and one radio button. When the enter key is pressed, I want to call my JavaScript function, but when I press it, the form is submitted. How do I prevent the form from being submitted when the…
Shyju
  • 214,206
  • 104
  • 411
  • 497
369
votes
13 answers

Submit form on pressing Enter with AngularJS

In this particular case, what options do I have to make these inputs call a function when I press Enter? Html:
/>
ali
  • 10,927
  • 20
  • 89
  • 138
338
votes
30 answers

Typing the Enter/Return key in Selenium

I'm looking for a quick way to type the Enter or Return key in Selenium. Unfortunately, the form I'm trying to test (not my own code, so I can't modify) doesn't have a Submit button. When working with it manually, I just type Enter or Return. How…
croixhaug
  • 3,767
  • 3
  • 19
  • 12
208
votes
12 answers

Enter triggers button click

I have a page with two buttons. One is a
Rob Wilkerson
  • 40,476
  • 42
  • 137
  • 192
75
votes
5 answers

How to insert a new line in strings in Android

I'm creating an android application and within it there is a button that will send some information in an email, and I don't want to have everything all in one paragraph. Here's what my app is doing for the putExtra for the email's body: I am the…
Reed
  • 14,703
  • 8
  • 66
  • 110
60
votes
6 answers

Default action to execute when pressing enter in a form

I've got a jsf 1.2 form with two buttons and several input fields. The first button discards the entered values and repopulates the page with values from a db, the second button saves the entered values. The problem occurs when the user presses…
Jörn Horstmann
  • 33,639
  • 11
  • 75
  • 118
48
votes
6 answers

Disable New Line in Textarea when Pressed ENTER

I am calling a function whenever someone press enter in the textarea. Now I want to disable new line or break when enter is pressed. So new line should work when shift+enter is pressed. In that case, the function should not be called. Here is…
Hassan Sardar
  • 4,413
  • 17
  • 56
  • 92
44
votes
4 answers

How to get the Enter key within a textbox to trigger a function and not the first/default button

I am trying to get the Enter key to trigger a function when it is pressed when inside a certain textbox, and not trigger the first or default button. You can see an example of what is happening here: http://jsfiddle.net/cutsomeat/WZ6TM/1/ If you…
MarkieB
  • 547
  • 1
  • 6
  • 12
38
votes
1 answer

Detect enter key pressed using javascript

Possible Duplicate: Javascript capture key I'm working on reply function using mysql and php. My MySQL db: reply: rid - id; topicid - under which topic; uid - id of the guy who replies; content - what did the guy said. Here's my html…
Matt
  • 565
  • 1
  • 7
  • 12
33
votes
7 answers

How do I tell when the enter key is pressed in a TextBox?

Basically, I want to be able to trigger an event when the ENTER key is pressed. I tried this already: private void input_KeyDown(object sender, KeyEventArgs e) { if (e.Equals("{ENTER}")) { MessageBox.Show("Pressed…
Jon
  • 2,566
  • 6
  • 32
  • 52
31
votes
10 answers

Submit form on Enter key with javascript

I'm not sure what I am doing wrong here. I want the enter key to work as well as clicking the button.
Mauro Golin
  • 411
  • 1
  • 4
  • 4
29
votes
5 answers

C#: How to make pressing enter in a text box trigger a button, yet still allow shortcuts such as "Ctrl+A" to get through?

Sorry for the long title, but I couldn't think of another way to put it. I have this: private void textBoxToSubmit_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { …
Jonathan Chan
  • 2,355
  • 3
  • 25
  • 38
24
votes
7 answers

Reliable way to know when android soft keyboard resigns (callback that works on every phone)

We are working on our first android app and it has been a very enjoyable experience so far. It is almost complete, but before release we are having some considerations ,mainly about android soft keyboard. We have a couple of EditText fields that…
Krishnabhadra
  • 34,169
  • 30
  • 118
  • 167
24
votes
9 answers

Excel doesn't update value unless I hit Enter

I have a very annoying problem in one of my worksheets in a workbook. I am using EXCEL 2007. Any cell's value will not be updated unless I hit ENTER. Either if the formula in the cell includes an if condition, or a VLOOKUP function or even an…
Thanasis
  • 695
  • 1
  • 4
  • 17
1
2 3
58 59