1. #1
    Sencha User
    Join Date
    Jul 2011
    Posts
    7
    Vote Rating
    0
    KCSureShot is on a distinguished road

      0  

    Default Number Field validation

    Number Field validation


    I am building a banking app using Sencha Touch. I have a Number Field on the screen that allows the user to type in a amount. I see no way to force numeric entry only, or to apply a mask to the box so that they type in numbers and it fills in from right to left auto inserting decimal. I see I can work with the keyup event. However keyup is too late. I need access to a keydown event. I'm not sure why Sencha chose to not include the keydown event in their Number Field. Does anyone know how this can be accomplished?

    Thanks

    KCSureShot

  2. #2
    Sencha User
    Join Date
    Jul 2011
    Posts
    7
    Vote Rating
    0
    KCSureShot is on a distinguished road

      0  

    Default SOLVED

    SOLVED


    Code:
    accountToAmountBox = new Ext.form.Number({
        inputType: 'number',
        cls: 'accountToAmountBox',
        initEvents: function () {
            Ext.form.Number.superclass.initEvents.call(this);
            var keyDown = function (e) {
                    if (notNumber(e.browserEvent.keyCode)) {
                        e.browserEvent.preventDefault();
                    }
                    this.el.on("keydown", keyDown, this);
                },
                label: 'Amount', labelWidth: '100%', labelAlign: 'top', required: 'true'
        });
    The code inside my keydown function could be whatever you like. The point is this causes that event to fire and your function to get called.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."