1. #1
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441
    Vote Rating
    1
    chrizmaster is on a distinguished road

      0  

    Default cannot read values from a textfield

    cannot read values from a textfield


    Hi,

    i am frustrated I wrote the code for logging in and it works so far. but you know what? I can't read values from my textfields "username" and "password". I tried a thousand ways, read the api, search for examples, but it seems this problem is so ridiculous, nobody really cares.

    Please help me.

    PHP Code:
    Ext.onReady(function(){

    createWindow(450,250,"Bitte loggen Sie sich ein.");
    })

    function 
    createWindow(p_widthp_heightp_title){
        
    var 
    win = new Ext.Window({
        
        
    widthp_width,
        
    heightp_height,
        
    resizabletrue,
        
    maximizabletrue,
        
    titlep_title,
        
    modaltrue,
        
    items:[{
            
    xtype:'form'
            
    ,id:'testform'
            
    ,defaultType:'textfield'
            
    ,frame:true
            
    ,defaults:{anchor:'95%'}
            ,
    items:[
                {
                    
    html:'<img src="images/icon_lock.png" width="40" height="40" />'
                    
    ,height:50
                    
    ,xtype:'panel'
                
    },
                {
                    
    fieldLabel:'Username'
                    
    ,id:'username'
                
    },
                {
                    
    fieldLabel:'Password'
                    
    ,id:'password'
                
    }
            ]
            ,
    buttons:[
                {
                    
    buttonAlign'right',
                    
    text"Login",
                    
    handler: function(){
                        
    Ext.Msg.alert("blA",testform.findField("username").getValue());
                        
    //utilities.login("http://localhost/ext/starter/login.php",{"loginUsername":
    "f""loginPassword""password"})
                    }
                },
                {
                    
    buttonAlign'right',
                    
    text"Abbrechen",
                    
    handler: function(){
                        
    Ext.Msg.alert("Abbruch""Login wurde abgebrochen");
                    }
                }            
            ]
        }]
        
    })
     
    win.show();    


  2. #2
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
    zhegwood is on a distinguished road

      0  

    Default


    field.getValue() or form.getForm().getValues() should return the values. Also, specifying a name attribute on the field is customary.

  3. #3
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    4
    tryanDLS is on a distinguished road

      0  

    Default


    I doubt you tried a thousand ways.

    What have you found via debugging? Set a breakpoint in the handler and inspect the variables. Stop debugging with alerts - you have to step thru the code.

  4. #4
    Sencha User chrizmaster's Avatar
    Join Date
    Feb 2009
    Location
    Australia
    Posts
    441
    Vote Rating
    1
    chrizmaster is on a distinguished road

      0  

    Default


    uh, u doubt it? really? if so then yes, u are right, i just tried 999 times

    anyway, how could I debug, if I am simply don't know, how I can reach that element? I know what debugging is and trust me, I wouldn't ask u such a question, if I did'nt try this already.

    Chriz

  5. #5
    Ext JS Premium Member
    Join Date
    Nov 2008
    Posts
    53
    Vote Rating
    0
    828 is on a distinguished road

      0  

    Default


    Ext.getCmp('username').getValue();
    Ext.get('username').dom.value = ''

    choose one.

    Also, check out login examples using Ext.Ajax.request instead of form.submit()

    you may have to set up params as well.

    var params = 'username:' + Ext.getCmp('username').getValue();

    then, on your request, just put in the params variable.

Thread Participants: 3

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..." hd porno faketaxi