Showing posts with label Escape Key twice on IE10 and below. Show all posts
Showing posts with label Escape Key twice on IE10 and below. Show all posts

Tuesday, April 21, 2015

Solution:IE 10 and below + Escape twice form values are clearing

Problem: IE 10 and below + Escape twice form values are clearing all input values/ Reset the form values.

Solution:

Add the below script to your document ready function.

$('input[type="text"]').keydown(function(e){
               var ingnore_key_codes = [27];
               if ($.inArray(e.keyCode, ingnore_key_codes) >= 0){
                  e.preventDefault();
               }
        });