Disabling the shortcuts such as Ctrl+A, Ctrl+B.... using Javascript

G

Gouri.Mahajan7

Hello,

Can anybody please tell me how to disable the shortcuts of the
internet explorer? I have hosted control on the web page and i want to
give the inputs such as Ctrl+A, Ctrl+B and so on.. but whenever I type
them pop up windows open in internet explorer. How to disable them??


Thanks.

Regards,
Gouri.
 
J

Joe Fawcett

Hello,

Can anybody please tell me how to disable the shortcuts of the
internet explorer? I have hosted control on the web page and i want to
give the inputs such as Ctrl+A, Ctrl+B and so on.. but whenever I type
them pop up windows open in internet explorer. How to disable them??


Thanks.

Regards,
Gouri.
Not sure this is ASP.NET but you look at handling the keydown and keypress
events. However not all key combinations can be cancelled and it's generally
poor UI practice to try to override standard combinations such as Ctrl+A
which the user might expect to select all text in a textarea, for example.

http://www.w3schools.com/jsref/jsref_onkeypress.asp
 
M

Munna

HI

I have tried this code but didn't work...
<script type="text/javascript">
document.onkeydown = function somefunction(e)
{
e = window.event;
//17 is keycode for "A"
if(e.ctrlKey == true && e.keyCode == parseInt("17") )
{
e.cancelBubble = true;
return false;
}
}
</script>

it detect the keys but the browsers still select the texts

Best of luck

------
Munna

www.munna.shatkotha.com/blog
www.munna.shatkotha.com
www.shatkotha.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top