Disable key strocks in IE and Firefox

H

Hemal2k

To disable specific key in IE and Firefox

Solution :-

//call ValidateInvalidCharacters(event); function from form body....

<body onkeypress="ValidateInvalidCharacters(event);" leftMargin="0"
topMargin="0">

// javascript function
function ValidateInvalidCharacters(e)
{

var key;

if(window.event)

key = window.event.keyCode;

else
{

key = e.which;
}

if(window.event)
{

if( (key == 39) || (key == 34) )
{
window.event.returnValue = false;
return false;
}
}
else
{
if((key == 39) || (key == 34))
{
e.returnValue = false;
e.preventDefault();

}
}
}
 

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,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top