Hence I had to find the following solution. (Works only in IE browser)
var dotReplace = false;
function keypressEvent(the_key) {
if(the_key == 46 && dotReplace) {
event.keyCode = 44;
}
}
function keydownEvent(the_key) {
if(the_key == 110) {
dotReplace = true;
} else {
dotReplace = false;
}
}
And in the form call the above functions for respective events.
<input name="disp" type="text"
onkeypress="keypressEvent(event.keyCode)"
onkeydown="keydownEvent(event.keyCode)">
Working Example:
Type a dot from the numeric pad here:
No comments:
Post a Comment