Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Ext User
    Join Date
    Sep 2007
    Posts
    6
    Vote Rating
    0
    yarmy is on a distinguished road

      0  

    Default Binding a Button's disabled/enabled state to a Form's validity state

    Binding a Button's disabled/enabled state to a Form's validity state


    So I want my submit button to be enabled/disabled depending on the form's validity status. For example,
    Code:
    var registerButton = new Ext.Button({
        text: 'Register',
        handler: function() {},
        disabled: true
    });
            
    var firstnameField = new Ext.form.TextField({
        fieldLabel: 'First Name',
        name: 'firstname',
        allowBlank: false
    });
    
    firstnameField.on('change', function() {
        registerButton.setDisabled(!formPanel.form.isValid());
    });
    
    var secondnameField = new Ext.form.TextField({
        fieldLabel: 'Second Name',
        name: 'secondname',
        allowBlank: false
    });
    
    var formPanel = new Ext.FormPanel({
        region: 'center',
        title: 'Register Form',
        labelWidth: 80,
        frame: true,
        defaults: {width: 200},
        items: [firstnameField, secondnameField],
        buttons: [registerButton]				
    });
    
    new Ext.Viewport({
        layout: 'border',
        items: formPanel
    });
    It seems the button's disabled property does change, but changing the property doesn't re-render the button.

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

      0  

    Default


    This functionality is already built into the Form - you don't have to code it yourself. Add formBind:true to the button config for any buttons in the form you want to manage. Then after creating the form, call form.startMonitoring(). This will check the form's validity on a timer and enable/disable the buttons. You should call form.stopMonitoring() before actually submitting so the timer doesn't continue to run.

  3. #3
    Ext User
    Join Date
    Sep 2007
    Posts
    6
    Vote Rating
    0
    yarmy is on a distinguished road

      0  

    Thumbs up Job's a good'un

    Job's a good'un


    Every day's a school day. Thanks.

Thread Participants: 1