Results 1 to 2 of 2

Thread: Button delete value of textField

  1. #1

    Default Button delete value of textField

    Hi,

    How can I delete the value on a textField?

    I have test:
    Code:
                    buttons: [{
                        text: 'Remise ? zro',
                        handler: function()
                        {
                            document.getElementById('id') = null;
                            document.getElementById('task') = null;
                            document.getElementById('date') = null;
                        }
                    }]
    width le id is defined here:

    Code:
    {
                    xtype:'textfield',
                    fieldLabel: 'id',
                    id:'id',
                    name: 'id',
                    disabled: true
                },{
                    xtype:'textfield',
                    fieldLabel: 'task',
                    id:'task',
                    name: 'task'
                },{
                    xtype:'textfield',
                    fieldLabel: 'date',
                    id:'date',
                    name: 'date'
                }
    But is not good:
    Code:
    invalid assignment left-hand side
    (174 out of range 148)
    Thank you for your help

  2. #2
    Sencha User jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    DC Area =)
    Posts
    16,364

    Default

    Code:
                            document.getElementById('id') = null;
                            document.getElementById('task') = null;
                            document.getElementById('date') = null;
    is invalid javascript, you can't nullify the result of a method call.

    how about: Ext.getCmp('id').setValue('') or reset()

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •