onkeyup

JQuery handling multiple key presses in IE and Firefox

Hi, I'm working on handling the multiple key presses with jQuery. I have two handlers: 1. keyDownHandler 2. keyUpHandler keyDownHandler detects if the certain key has been pressed, if yes it sets a certain boolean value to true and carries on with the processing. keyUpHandler resets the boolean value to false. All this is required...

$('#searchfield').keyup(function(e){

Hi, i have a little question. Is it possible to call the keyup function with an extra value? For example $('#eld').keyup(function test(e,val2){ test('','hallo'); But this will not work. Any ideas? Kind regards Peter ...

How do I keep my cursor/caret from moving inside of an input text element?

I'm trying to build a form that works in a manner similar to the Google Search page, as well as Gmail and several other pages (including the this page - see the "Tags" input on the Ask Question page). As text is input, a list of options will appear, and the user can use up and down arrows to select the option they want. The problem I a...

JavaScript/jQuery: Keypress for keyboard navigation (event.which doesn't work)

When handling key[Up|Down|Press] events, should I use .which or .keyCode? Can I have some example code for handling the three keyboard events in jQuery? Can you do it without jQuery? I want it to work reliably in every browser. Update Strangely, jQuery's event.which normalization wasn't working for my handleKeyPress(event) handler: //...

Android Development: How To Use onKeyUp?

I'm new to Android development and I can't seem to find a good guide on how to use an onKeyUp listener. In my app, I have a big EditText, when someone presses and releases a key in that EditText I want to call a function that will perform regular expressions in that EditText. I don't know how I'd use the onKeyUp. Could someone please s...

jquery: do this on keyup, unless the person is in a textarea or input.

my script works but i don't understand how to make it NOT launch the functions when in a textarea/input and those keys are pressed. aka: launch the event when the user presses that key, unless the user is in a textarea/input. $('body').keyup(function (event) { var direction = null; if (event.keyCode == 37) { $('#wrapper').fadeOut(500...

conditional check for focus is in textarea or input field

$('body').keyup(function(e) { var code = e.keyCode ? e.keyCode : e.which; switch(code) { case 8: alert('blah'); break; } }); When a user hits backspace, I want the alert to pop up UNLESS the cursor is positioned within a textearea, input, etc. Any ideas on how to do this? ...

jQuery key code for command key

I have read http://stackoverflow.com/questions/302122/jquery-event-keypress-which-key-was-pressed and http://stackoverflow.com/questions/2445613/how-can-i-check-if-key-is-pressed-during-click-event-with-jquery However my question is if you can get the same key event for all browsers? Currently I know that Firefox gives the command butto...

jQuery keyup and 'enter' in Safari

I am using jQuery and want to make it possible for the user to hit enter after entering data into a search field to start the search. I'm using the following code: $('#textSearch').keyup(function (event) { if (event.keyCode == '13') { doSearch(); } return false; }); ...

javascript - capture input and convert characters

I want to capture input charcters in text box, convert then according to a table and put them back in text box as user types. <form id='myForm'> Enter phone number:<input type="text" id='idMyText' name="myText" onKeyUp="alphaToNum(this.value)"> </form> <script> // on each keypress in input box, I want to capture key pressed, // det...

onkeyup event JavaScript

Hello. Here is my code : function search_buddy() { $.post("num.php",function (ret){ num=ret; }); $("#Layer7").html(num); } </script> <div id="Layer8"> Find a buddy : <input type="text" id="search" onkeyup="search_buddy()"/>&nbsp;: </div> Now,when i enter one character into the text box with i...