FAQ Database Discussion Community


Keyup event for iOS applications using swift

ios,swift,keyup
I want to use keyup/keydown event for my iOS application using swift as NSEvent is used for OS X not for iOS. Any quick help will be appreciated. ...

Angular: How to get an input value using $this

javascript,angularjs,this,keyup
I am hoping to get an input value inside a keyup function that can runs from multiple inputs. Every time there is a keyup the function will trigger according to the specific input. So, I am trying to use $this inside the function. No succes so far.. HTML code: <input...

Finding and adding value to closest input field on keyup

jquery,keyup
I want to add a value to closest input field on keyup. But it is not working in dynamically added fields. $(document).on('keyup', '.rate_qar' , function() { var qar_rate = $('#conv_rate_usd').val(); var usd_rate = 10*qar_rate; $(this).parent('tr').find('input.rate_usd').val(usd_rate); }); But it is not working. How can i do that? My HTML is given...

Alt key behaviour with Javascript on Chrome/Windows 7?

javascript,jquery,html,keydown,keyup
I'm trying to emulate a behaviour of a windows menu where you could navigate menus using an combination like: alt + KEY + KEY ... as a simple test I did this: $(document).on('keydown', function(e) { $(".dropdown>a").css("text-decoration","underline"); }).on('keyup', function(e) { $(".dropdown>a").css("text-decoration","") }); Which should add or remove an underline for all...

jQuery replace day input to 00 if higher than 31

jquery,replace,keyup
I am currently working on a age verification page and I need to make a jQuery script that will check if the date is correct, go to the next input and validate the user. //Age Verification $('.inp .day, .inp .month, .inp .year').on('keyup', function () { this.value = this.value.replace(/[^0-9\.]+/g, ''); });...

Trouble with jQuery keyup()

javascript,jquery,keyup
The page reloads instead of calling the click function, but if I insert a query string ?# after the .html extension, it works. Tested in chrome My code: <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script> $(document).ready(function () { $('#search_btn').click(function () { alert("searching"); // search functions }); $("#search").keyup(function (event) { if (event.which ==...

How to detect shift + right arrow + some other key in angular

javascript,angularjs,keyboard-shortcuts,keyboard-events,keyup
I have a problem to detect shift + right arrow + p in angular. I am using angular 1.2.3 I have no problem to detect only right arrow + p but when the shift comes into game something brakes The question is hot to detect situation when 3 keys are...

Simplifying some jQuery code of keyup inputs

javascript,jquery,css,input,keyup
Thing that I'm making I am making a webpage, which is to generate forum code automatically when I enter content into inputs. Each character will be in different colors and the sentence will look like a gradient. This is the jsfiddle sample. When I enter a-p-p-l-e in to those inputs,...

If textarea contains certain string then

javascript,jquery,keyup
I am creating a contact form for my website, and I am adding a few joke easter eggs which trigger if a user chooses a certain option or in this case happens to type a certain string into the message textarea. I would like to be able to trigger the...

jquery keyup delay is being ignored

javascript,jquery,ajax,timeout,keyup
Ok perhaps someone could enlighten me as to what I am missing here guys. I have a text box which updates a jquery data table with ajax call based on user input. Obviously the desire is to only fire the ajax call when the user has finished typing. However no...

Best practice to maintain cursor position when keyup triggers save

javascript,backbone.js,keyup
I'm using Backbone.js. In my view, I have a textarea whose keyup is bound to a function like this (but see edit below): this.model.save({text: self.$('textarea').val()}, {patch: true}); In the view's initialize function, I bind the model's change event to the view's render function: initialize: function() { this.listenTo(this.model, 'change', _.bind(this.render, this));...

jQuery getting ID of input with class on keyup not working

javascript,jquery,input,this,keyup
I have a bit of problem with my code here. What I am trying to accomplish is to get the ID of an input field on key up. All the input fields of interest have a class "count". All of them also have the same ID but it increments, say...

Combining .change() and keyup

javascript,jquery,keyup
I have two functions that I would like to combine into one. Is it possible to combine... $(document).ready(function () { $(".jobtype").change(function () { if ($("select[name='jobtype']").val() != "Low Budget") { // something happens } }); }); and this... $(document).ready(function () { $(document).on('keyup', function (evt) { if (evt.keyCode == 27) { //...

JQuery loop on multiple items of the same CSS class

jquery,loops,each,keyup,word-count
I have multiple fields of the same class. The word count shows up correctly, but changes the value of every word count when one field has received input. Additionally, I'd expect the field to show a word count of 100 if no input exists, but it shows 0. Suggestions on...

Show message if all Li are hidden

javascript,jquery,keyup,jquery-filter
What i want is that if on keyup() if all the li are hidden then show a specfic div.I Following is my Jquery Code. Currently what is happening is that div is displayed when ever it 1st meets its success scenario, my fiddle will explain the scenario more. var showMessage...

How to remap keyboard within the same textarea

javascript,jquery,html,keyboard-events,keyup
Currently i am doing a project with remapping characters to words by detecting the keyup function. Unfortunately, i have only been able to retrieve the first character and remap to the word i want. In my project, i need to directly retrieve all of my keyboard input and directly convert...

jQuery event.keyCode for Enter (13) is skipped if there are required fields in the HTML

jquery,keyup,required-field
I am using the required="yes" attribute in a few fields within my form. I have a search box within the form to auto-populate a drop-down list if the item they are looking for is not already on there. In my jQuery, I watch the keyup event for the field. $("input#search-input-text").keyup(function(event){}....