May 04, 2012, 8:44 AM
[CLOSED] KeyDown and KeyPress Event
Hi.
I'm working on EXT.NET TextField to show alert message up when Input was Korean.
The problem is it is worked for some of computers with KeyPress , but some computers didn't work with it.
So, I changed it to KeyDown event. It also worked for some computers, not for all
Testing environment was IE9 on Window 7.
Could you please let me know what kind of event I have to use ?
I'm working on EXT.NET TextField to show alert message up when Input was Korean.
The problem is it is worked for some of computers with KeyPress , but some computers didn't work with it.
So, I changed it to KeyDown event. It also worked for some computers, not for all
Testing environment was IE9 on Window 7.
Could you please let me know what kind of event I have to use ?
<script type="text/javascript">
var NumCheck = function (field, e) {
var keycode = window.event ? window.event.keyCode : e.which;
if ((48 <= keycode && keycode <= 57) || keycode == 0 || keycode == 45 || keycode == 8 || keycode == 9 || (96 <= keycode && keycode <= 105)) {
return;
} else {
alert("Inpt only Number.");
window.event.returnValue = false;
}
}
</script>
<ext:TextField ID="DayPoint_Text" runat="server" Width="150" MaxLength="3" ClientIDMode="Static" Cls="ver_m2" EnableKeyEvents="true">
<Listeners>
<KeyDown Fn="NumCheck" />
</Listeners>
</ext:TextField>
Last edited by Daniil; May 08, 2012 at 11:31 AM.
Reason: [CLOSED]