[CLOSED] KeyDown and KeyPress Event

  1. #1

    [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 ?

    <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]
  2. #2
    Hi,

    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
    Please provide more details. What environment does it work? What environment does it not work? What keys are you trying with?

    Also please try to replace
    var keycode = window.event ? window.event.keyCode : e.which;
    with
    var keycode = e.getKey();

Similar Threads

  1. TriggerField KeyPress event
    By reyonlines in forum 1.x Help
    Replies: 8
    Last Post: Oct 08, 2013, 6:29 AM
  2. [CLOSED] keypress event
    By RomualdAwessou in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 18, 2011, 3:53 PM
  3. [CLOSED] KeyDown Event Not Firing
    By JonG in forum 1.x Legacy Premium Help
    Replies: 11
    Last Post: Jun 04, 2010, 1:57 PM
  4. [CLOSED] KeyPress,KeyDown,KeyUp Events not firing
    By randy85253 in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Aug 23, 2009, 5:08 PM
  5. MultiHeader keydown event
    By methode in forum Open Discussions
    Replies: 5
    Last Post: Mar 04, 2009, 4:29 PM

Posting Permissions