keyup

Jquery: filter input on keypress

混江龙づ霸主 提交于 2019-12-29 06:21:07
问题 I have a text field, which will accept only the following characters: Allowed characters: [a-z 0-9 + # - .] This is the same filter SO does in the 'Tags' field, when you're asking a question. If the user types an invalid character, i want the current text field value to remain unchanged. I tried: $('#post_tags').keypress(function(event){ var char = String.fromCharCode(event.which) var txt = $(this).val() if (! txt.match(/[^A-Za-z0-9+#-\.]/)){ $(this).val(txt.replace(char, '')); } }) Why it

ListView KeyUp Error for the Control Key

好久不见. 提交于 2019-12-29 02:07:08
问题 ListView.KeyDown <Ctrl> event shows the following: e KeyData = LButton | ShiftKey | Control base {KeyData = LButton | ShiftKey | Control} Alt false bool Control true bool Handled false bool KeyCode LButton | ShiftKey KeyData LButton | ShiftKey | Control KeyValue 17 Modifiers Shift false bool SuppressKeyPress false bool I don't like the fact that the <ShiftKey> is showing up but the Control key is showing up. On ListView.KeyUp <Ctrl> event shows the following: - e {KeyData = LButton | ShiftKey

ajax call on keyup()

纵然是瞬间 提交于 2019-12-24 14:30:30
问题 I have an issue: if someone is typing in field, this should make the text field for all other user as readonly and show msg like "someone is typing right now". <div id="msg"></div> <input type="text" name="field" id="field" /> $("#field").keyup(function (){ var isTyping = $('#field').val(); var data = 'result=' + isTyping; var msg = $('#msg'); $.ajax({ type: 'POST', url: "includes/control.php", data: data, cache: false, success: function(){ msg.html(html); } }); }); And this is control.php:

Javascript issue with keyup function - trying to use same form field on page multiple times but only 1st form field works

血红的双手。 提交于 2019-12-24 13:10:51
问题 I have multiple vocabulary tables on the same html page. Above each vocabulary table, I would like to enable users to enter a word or phrase in a field to view only the table rows that contain the entered word or phrase. For example, if you enter "orde", the table rows that do not contain the string "orde" will disappear. This is already working if you visit http://www.amanado.com/idioma-colombiano/, click on "Vocabulario (oficial y de jerga) - palabras y frases comunes" to expand the

Autocomplete textarea text after click result on list jquery

别来无恙 提交于 2019-12-24 09:58:46
问题 I'm making a textarea for users to create posts. In those posts they have the possibility to tag someone @myfriend . I successfully with @NiMusco help, developed the jquery code, but what I'm getting into trouble at the moment of autocompleting after clicking one of the results, for example replace @Jean (listed result) by @Je written within the textarea. <textarea id=inline_search></textarea> <div > <ul id=show_inline_users> </ul> </div> The php outputs json data, this type $arr[] = array(

Ctrl+V ( Paste ) triggers jQuery's keyup function TWICE

不问归期 提交于 2019-12-24 01:45:10
问题 How to make Ctrl + V or Paste not trigger the keyup function TWICE? This is a problem for me because I made an AutoComplete functionality, and it displays the same data twice when i paste in a textbox. I hope this makes more sense now. EDIT: Okay guys, I have found out how to detect Ctrl + V by $('#this-id').bind('paste', function() {}); But now another follow up question is how to combine it with keyup so that when paste is pressed, keyup wont trigger anymore. 回答1: Okay guys, Thank you all

Cell in editmode doesn't fire OnKeyDown event in C#

烂漫一生 提交于 2019-12-22 08:27:05
问题 I've made own datagridview control which ovveride OnKeyDown event: public partial class PMGrid : DataGridView { protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { e.SuppressKeyPress = true; //suppress ENTER //SendKeys.Send("{Tab}"); //Next column (or row) base.OnKeyDown(e); } else if (e.KeyCode == Keys.Tab) { base.OnKeyDown(e); this.BeginEdit(false); } else { base.OnKeyDown(e); } } } When I click on datagridview and press Enter it works perfect because row isn

Angular2 keyup event update ngModel cursor position jumps to end

好久不见. 提交于 2019-12-21 09:38:06
问题 I am having an issue with an Angular2 directive that should do the following: Detect if the user enters '.' character. If the next char is also '.', remove the duplicate '.' and move the cursor position to after the '.' char I have the above working, however, when using this in combination with ngModel, the cursor position jumps to the end every time the model is updated. The input: <input type="text" name="test" [(ngModel)]="testInput" testDirective/> The directive: import {Directive,

keydown + keyup events for specific keys

让人想犯罪 __ 提交于 2019-12-18 11:32:00
问题 I'm trying to make the background color change when certain keys are held down. For example, when the 'r' key is being held down, the background should be red. When the 'r' key is not being pressed anymore, the background should default to white. $(document).ready(function () { $('body').keydown(function(e){ if(e.keyCode == 114){ $(this).css({'background':'red'}); } if(e.keyCode == 121){ $(this).css({'background':'yellow'}); } }); $('body').keypress(function(e){ if(e.keyCode == 114){ $(this)

onkeyup event in Safari on IOS7 from a bluetooth keyboard

走远了吗. 提交于 2019-12-18 08:33:18
问题 I have the following setup: Bluetooth scanner iPad Webpage with a textfield for scan input Usage: User focus textfield and scan barcode with bluetooth scanner Scanner adds ENTER (13) at the end of the scan Problem: On Safari in IOS7 there seems to be a change on how keyboard events are handled on bluetooth devices. The code ... window.onkeyup = function (e) { console.log(e.KeyboardEvent) } ... should return information about the key pressed. Instead i get ... keyCode: 0 keyIdentifier: