What do you want to save?
Add Code snippet
New code examples
-
Other 2022-01-30 01:25:48
session timeout minutes for in 1*60 *1000
var IDLE_TIMEOUT = 2700; //seconds 45min var _idleSecondsCounter = 0; document.onclick = function() { _idleSecondsCounter = 0; }; document.onmousemove = function() { _idleSecondsCounter = 0; }; document.onkeypress = function() { _idleSecondsCounte... Add solution -
Html 2022-01-26 17:32:25
html button press enter off
Explicit Prevention: <form> <label for="name">Name:</label> //Not able to press `Enter` <input type="text" name="name" onkeypress="ExplicitPrevention(event)"> //Able to press `... Add solution -
Other 2021-11-19 13:08:11
Capturing enter in javascript
//You can use onKeyPress directly on input field. onChange function changes //state value on every input field change and after Enter //is pressed it will call a function search(). <input type="text" placeholder="Search..."... Add solution -
Other 2021-11-14 12:57:23
event.charcode to only allow thai characters
<input type="text" id="firstName" onkeypress="return (event.charCode >= 65 && event.charCode <= 90) || (event.charCode >= 97 && event.charCode <= 122) || (event.charCode >= 48 && event.ch... Add solution -
Python 2021-11-05 14:07:13
python turtle onkeypress
#Importing the module import turtle #The window creation window = turtle.Screen() #The turtle creation p = turtle.Turtle() p.color("black") p.penup() #the function def move(): p.forward(20) #The event listener turtle.listen() turtle.onkeyp... Add solution -
Html 2021-11-05 13:43:19
accept only numbers in textbox
<input type="text" onkeypress="return isNumberKey(event)" placeholder="Phone Number"> //this will accept only numbers from 0 to 9 <script> function isNumberKey(evt) { var charCode = (evt.which) ? evt.which : even... Add solution -
Other 2021-11-03 13:05:08
keydown or keyup event to check character
function isCharacterKeyPress(evt) { if (typeof evt.which == "undefined") { // This is IE, which only fires keypress events for printable keys return true; } else if (typeof evt.which == "number" && evt.w... Add solution