Menu
  • HOME
  • TAGS

When user inputs string, nothing happens upon pressing enter

java,enter

The p in the borrowsManual while loop needs to be incremented, otherwise it will run in a endless lopp. while (p < borrowedManuals.size()) { Manual borrowed = borrowedManuals.get(p); // guessing the name of this class if (borrowed.title.equalsIgnoreCase(returnManualTitle)) { borrowedManuals.remove(p); break; } p++; // this is mising } (I am not...

DOS debug.exe does not want to enter a string

command,dos,enter

Looks like I figured out how to enter message in DOS - I had to use double-quotes instead of single. Strange... Anyway I finally got it working...

Prevent enter key from triggering button

jquery,ember.js,preventdefault,enter

Do this $("#inputBox").on('keydown', function(event) { if (event.key == "Enter") event.preventDefault(); }); ...

Refresh page when press enter

jquery,refresh,imagebutton,enter

Something like this might work for u mate.. :) HTML <form id="myForm"> <div id="main"> <div> <ul> <li> <asp:TextBox ID="txtDate1" runat="server" CssClass="textbox"></asp:TextBox> <asp:ImageButton ID="Button1" CssClass="calbutton" runat="server" OnClick="Button1_Click" Text="Show Calendar" AutoPostBack="True" /> <div class="calendar"> <asp:Calendar ID="Calendar1" runat="server" OnSelectionChanged="Calendar1_SelectionChanged" Visible="False"></asp:Calendar>...

Use Enter Key Act Like Tab Key on jTable

java,swing,tabs,jtable,enter

The basic twist would be to use the key bindings API, which will allow you to override, in most cases, the default behaviour keys on many components. This example basically applies the same named action to the Enter and Tab keys, this makes it easy to modify their behaviour through...

Submit form on keypress in textarea

javascript,jquery,submit,enter,onkeyup

You need to rename your submit button, you are overridding the submit method. Change <input id="submit" type="submit" name="submit" value="Send" /> to <input id="btnSubmit" type="submit" name="btnSubmit" value="Send" /> and change $('#form').submit(); to $('#form')[0].submit(); or $('#form').get(0).submit(); ...

DONE key on android keyboard

android,android-softkeyboard,enter,ime

Instead of ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER)); try ic.performEditorAction(EditorInfo.IME_ACTION_GO); The action performed should be the one defined on the EditorInfo, which is passed to you on method onStartInputView To switch between actions, use this: (sEditorInfo.imeOptions & (EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) Hope this helps. Code: case -1: switch (sEditorInfo.imeOptions & (EditorInfo.IME_MASK_ACTION|EditorInfo.IME_FLAG_NO_ENTER_ACTION)) { case...

Cross-component communication via return key

javascript,reactjs,enter

Your code is a bit messy but a quick fix will be to add: this.props.enter(this.refs.inputEl.getDOMNode().value); where your console.log() is. I will edit my answer with the full explanation once I'm on my laptop...

On Enter fire javascript function

javascript,jquery,alert,enter

First you need to say #input1 other than .input1, then run it when the entire DOM is ready: $(document).ready(function(){ $("#input1").keyup(function (e) { if (e.keyCode == 13) { alert ("It Works"); } }); }); Edit: As @jfriend00 mentioned in a comment it's a good idea to use e.which other than e.keycode....

KeyPress event doesn't trigger on WinForm UserControl

c#,winforms,keypress,enter

Does that particular form have its AcceptButton set? (Already answered in comments) This SO question might be relevant for fixing up the Form: Prevent WinForm AcceptButton handling Return key...

Getline doesn't work when push Enter

getline,enter

New Line character depends on the operating system. Reminder - \r\n or \n\r? I would leave out the third parameter of the getline call all together. This will use getline's default behavior and terminate the read on the enter key. EDIT: After reading you are still having problems, I decided...

C program: keyboard does not recognise enter using getch()

c,enter,getch

It seems that the newline is assumed CR (= 13). But it can be LF (= 10). Please try to add one more condition to the while loop: while((ch=mygetch()) != EOF || ch != 10 || ch != 13 || z<sizeof(password)-1) { ...

How to allow the user to press enter with no iformation without crashing and for it to show incorrect instead of showing an error

c#,menu,return,enter

Instead of using char.Parse(), try char.TryParse(): .... Console.WriteLine("Q: to quit the program"); if (!char.TryParse(Console.ReadLine(), out choice) { continue; // Assuming your do/while loop will just loop. Might need to modify the while condition } switch (choice) ... ...

C++ How check characters in real time with _getch() [closed]

c++,input,char,enter,getch

include using namespace std; int main() { cout << "Press the ENTER key"; if (cin.get() == '\n') { cout << "Good job.\n"; } else { cout << "I meant ONLY the ENTER key... Oh well.\n"; } return 0; } This code will help in detecting the ENTER key when pressed....

Unable to prevent an input from submitting when press the enter key on it

html,get,submit,enter,preventdefault

Try changing your keypress event to keydown because the default behavior of the Enter key is captured on keydown so you have to prevent it at the point where it starts doing its default action. Here's a working sample: <!DOCTYPE html> <html> <script> function selecting_key(whatKey){ if(whatKey.keyCode==13){ whatKey.preventDefault(); } } </script>...

How to avoid selecting textbox value when press Enter?

c#,windows,enter

You can tell the TextBox to select nothing Control nextControl; if (e.KeyCode == Keys.Enter) { nextControl = GetNextControl(ActiveControl, !e.Shift); if (nextControl == null) { nextControl = GetNextControl(null, true); } nextControl.Focus(); TextBox box = nextControl as TextBox; if (box != null) box.Select(box.Text.Length, 0); e.SuppressKeyPress = true; } ...

Polymer fire on-tap with enter

javascript,html,button,polymer,enter

Something like this could work: Polymer('dialog', { onClick: function () { // etc.. }, onKeyDown: function (e) { if (e.which === 13 || e.keyCode === 13) { this.onClick(); } }, attached: function () { this.onKeyDown = this.onKeyDown.bind(this); document.addEventListener('keydown', this.onKeyDown); }, detached: function () { document.removeEventListener('keydown', this.onKeyDown); } }); where attached...

JS Getting an unwantend 'enter/return' when pressing enter

javascript,forms,input,enter

Well if you do not want it than cancel it with preventDefault $('.inputs').keydown(function (e) { if (e.which === 13) { e.preventDefault(); //put focus code here } }); ...

Press enter to continue oddities (Java)

java,enter,continue

System.in.read() reads one byte. My guess is you are running your code on a platform where a newline is represented by a two byte CR LF sequence, so pressing the Enter key satisfies the first System.in.read() call with the CR, and the second System.in.read() call with the LF. Changing your...

Pressing the enter key to fire Onclick function, with multiple forms

jquery,onclick,enter

The problem is here in your code. You've attached an event delegate that responds to the same type of element. Because both listeners have form input[type="text"] each one will fire when you click on something that is a child of document, and matches that css selector. You need something that...

How to make [Enter] only run a handler?

javascript,html5,enter

Since you are using a form field (input or textarea) the [enter] key is mapped to 'submit' the form. You need to prevent the default action behavior using event.preventDefault(): window.addEventListener('keypress', function (e) { if (e.keyCode === 13) { e.preventDefault(); feedTheList(); } }); ...

Keyboard enter button on input

javascript,input,enter

I am adding fiddle : http://jsfiddle.net/nzu27rw4/1/ make sure that you have added jquery reference on the top of this script $(document).ready(function(){ $('#info').keypress(function(e){ if(e.keyCode==13) $('#bn').click(); }); }); function read() { alert('read') } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <input type="text" id="info" name="info" /> <input type="button" id="bn" name="bn" value="click" onclick="read()" /> ...

How can I print what is read by intputstream immediatly?

java,io,stream,enter

Sadly there's no way to do this with the console in Java. No matter whether you use a java.util.Scanner or a kind of java.io.InputStream (including System.in directly), the Enter key is always the trigger for input to be received. Consider using a graphical user interface like Swing (definition on wikipedia),...

click textbox (to enter characters), when submit is clicked

textbox,click,submit,enter

Could you reformulate please ? Not very clear, here... By the way, if you want to get the value of "textbox" with the following instruction " var txt = document.getElementById("textbox"); " , then you need to correct it like this : var txt = document.getElementById("textbox").value;...

fire a button with pressing ENTER after coming with TAB to it

javascript,html,tabs,enter,keycode

here is my solution: part of HTML, close button is a div element and is a part of a modal window: ... <div class="closeButton"> <span id="closeSpan" tabindex="0">Close</span> </div> ... JS, within the ModalWindow class: $(modWin).find("#closeButton").one("click", this.close).keypress(this.doNothing); this.close = function () { $("#modalWindow").css("display","none").fadeOut(200).html(""); $("#modalWindow #closeButton").hide(); $(window.self.document.body).find("#modalWindow").remove(); } this.doNothing = function (e)...

Swift Programming: Evaluate value in a string [duplicate]

cocoa,swift,enter,evaluate

For your second question, assuming you're using a textField, you can use the delegate method: - (BOOL)textFieldShouldReturn:(UITextField *)textField This method is executed when the return key is pressed. If don't want to hide the keyboard, you need to return NO from this function at the end. If you're using a...

How can the cursor goes to next text field when i press key Enter?

jsp,enter,onkeypress

To change focus to another inputtext people usually hit tab instead of enter.. However you can do that with jquery event handler.. $( "#your-username-input" ).keypress(function( event ) { //press enter button if ( event.which == 13 ) { $( "#your-other-input" ).focus(); } ...