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();
}
}
}
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();
}
}
}