Disable backspace key using Jquery
Disable backspace key in HTML form using Jquery in simple steps.
While user enters data into application if user accidentally press backspace button then it will redirect to previous page and all entered data would be lost. to eliminate this event we can disable the backspace key using Jquery.
Following is the JQuery script tag you can add to the web page
While user enters data into application if user accidentally press backspace button then it will redirect to previous page and all entered data would be lost. to eliminate this event we can disable the backspace key using Jquery.
Following is the JQuery script tag you can add to the web page
$(document).keydown(function (e) {
var nodeName = e.target.nodeName.toLowerCase();
if (e.which === 8) {
if ((nodeName === 'input' && e.target.type === 'text') ||
nodeName === 'textarea') {
// do nothing
} else {
e.preventDefault();
}
}
});
The above code can be used seamlessly with any web technology you are using. Hope this will help you in your web application.
Happy coding:)
thanks :D
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeletethanks :)
ReplyDeleteTHX BRO
ReplyDeleteI like your all post. You have done really good work. Thank you for the information you provide, it helped me a lot. I hope to have many more entries or so from you.
ReplyDeleteVery interesting blog.
simple-disable-key Crack
Hi nnice reading your post
ReplyDelete