textinput

js disabling backspace functionality in firefox

痴心易碎 提交于 2019-12-17 20:39:37
问题 I have following javascript to prevent user from entering invalid characters into a text field. It's working well in chrome but not in firefox. It's preventing the backspace key to be entered in the text field in firefox. function onlyNumbers(evt) { var theEvent = evt || window.event; var key = theEvent.keyCode || theEvent.which; key = String.fromCharCode( key ); var regex = /[0-9]|\./; if( !regex.test(key) ) { theEvent.returnValue = false; if(theEvent.preventDefault) theEvent.preventDefault(

Caret position in pixels in an input type text (not a textarea) [duplicate]

你离开我真会死。 提交于 2019-12-17 15:39:48
问题 This question already has answers here : How do I get the (x, y) pixel coordinates of the caret in text boxes? (3 answers) Closed 5 years ago . UPDATE : duplicate of Get cursor or text position in pixels for input element. TL; DR - use the incredibly lightweight and robust textarea-caret-position Component library, which now supports <input ype="text"> as well. Demo at http://jsfiddle.net/dandv/aFPA7/ Is there a way to know where the caret is inside an HTML text field? <input type='text' /> I

Caret position in pixels in an input type text (not a textarea) [duplicate]

无人久伴 提交于 2019-12-17 15:39:09
问题 This question already has answers here : How do I get the (x, y) pixel coordinates of the caret in text boxes? (3 answers) Closed 5 years ago . UPDATE : duplicate of Get cursor or text position in pixels for input element. TL; DR - use the incredibly lightweight and robust textarea-caret-position Component library, which now supports <input ype="text"> as well. Demo at http://jsfiddle.net/dandv/aFPA7/ Is there a way to know where the caret is inside an HTML text field? <input type='text' /> I

How to disable Paste (Ctrl+V) with jQuery?

浪尽此生 提交于 2019-12-17 07:03:01
问题 How can I disable Paste ( Ctrl + V ) option using jQuery in one of my input text fields? 回答1: This now works for IE FF Chrome properly... I have not tested for other browsers though $(document).ready(function(){ $('#txtInput').on("cut copy paste",function(e) { e.preventDefault(); }); }); Edit: As pointed out by webeno, .bind() is deprecated hence it is recommended to use .on() instead. 回答2: Edit: It's almost 6 years later, looking at this now I wouldn't recommend this solution. The accepted

How to disable Paste (Ctrl+V) with jQuery?

大城市里の小女人 提交于 2019-12-17 07:02:20
问题 How can I disable Paste ( Ctrl + V ) option using jQuery in one of my input text fields? 回答1: This now works for IE FF Chrome properly... I have not tested for other browsers though $(document).ready(function(){ $('#txtInput').on("cut copy paste",function(e) { e.preventDefault(); }); }); Edit: As pointed out by webeno, .bind() is deprecated hence it is recommended to use .on() instead. 回答2: Edit: It's almost 6 years later, looking at this now I wouldn't recommend this solution. The accepted

Horizontal scroll on text input

独自空忆成欢 提交于 2019-12-13 21:45:43
问题 I got two input text. First one is for an email, the problem comes when I write more text than the width of this input, the rest of the text doesn't see. The normal behavior would be scroll horizontally to see the rest of the text, right? I don't know if I'm missing something, but it doesn't work. Here is the example code: rnplay.org Edit: This is the effect I wanna get, this is from UI Explorer Example from official React Native repo: Thank you! 回答1: I was be able to solve it. I don't know

collect value only from the text input that have been changed

扶醉桌前 提交于 2019-12-13 18:19:38
问题 I have a html page that after ajax call show a lot of data rows, in every row i have input text with different value, the user can edit this text input and then press a button to do some calculate action. How can I collect with javascript(jQuery) only this values that have been changed, and send them to php script. I search a simple way, not to save all big array of old values then compare with new values, Is there such solution? 回答1: You can use the .data() function to keep a copy of their

Flex - Search/Filter DataGrid by Text Input

允我心安 提交于 2019-12-13 10:25:52
问题 I’m using a filter setup that I found online and I’m having trouble filtering my mx:DataGrid using three components – comboBox, checkbox and text input. The checkbox and comboBox are working properly with my IFilter interface and Filter class, but I’m unable to get the search input working correctly. Here’s of the code from the source files package com.daveoncode.filters { //Defines a common interface that must be implemented by all the filters. public interface IFilter { function apply(item

when text changed inputbox automatically updates next 6 text boxes

折月煮酒 提交于 2019-12-13 06:42:04
问题 I have 7 textboxes. If Top 1 textbox( Volume All Years ) text changed, text need to be updated in next 6 inputboxes( Latest 2009 Volume to Latest 2014 Volume ). I need javascript or Jquery for this. I will write Js textchanged() or focuschange() for top 1 textbox. So what should I write in focuschage() or textchanged methods() <tr id="row12_136" class="RegText"> <td style="width:420px;Padding-right:20px;">Volume All Years</td> <td style="width:420px;Padding-left:0px;"> <input name="12_136"

bokeh layout vertical alignment with buttons

情到浓时终转凉″ 提交于 2019-12-13 05:07:43
问题 I am looking for a workaround to an issue in Bokeh. When you put a button and a text input in a row- they will be un-alighned. This effect happens because the text input has a label and is described here: https://github.com/bokeh/bokeh/issues/4817 screenshot of messed up alignment Example code: # hello.py from bokeh.io import curdoc from bokeh.layouts import column, row from bokeh.models.widgets import TextInput, Button, Paragraph # create some widgets button = Button(label="Say HI") input =