PDA

View Full Version : how do I get the current value from a form field?



nickweavers
23 Feb 2010, 11:37 AM
I am struggling to figure out what object.method(s) to use to get the value held by the id_event field in the eventDetailsFieldset despite having read everything I can find... guess it's a case of 'old dog ... new tricks' :-/


var eventDetailsFieldset = {
xtype: 'fieldset',
labelWidth: 90,
title: 'Event details',
items: [{
id: 'id_event',
fieldLabel: 'BookingID',
name: 'id_event'
]};

var worksheetForm = new Ext.FormPanel ({
title: 'Worksheets',
closable: true,
layout: 'column',
...
items: [{
xtype: 'fieldset',
title: 'Event selection',
...
items: [{
xtype: 'panel',
anchor: '100%',
items: [ eventSelector ]
}]
}, {
...
items: [ eventDetailsFieldset ]
}]
});

var = worksheetForm.getForm().findField("id_event").getValue();


Firebug says: worksheetForm.getForm().findField("id_event") is null

I traced my way down through formPanel which provides getForm(), through basicForm which provides findField() and field which provides getValue().

Where have I strayed off the true path?

Can someone explain it simply?

TIA,
Nick.

bclinton
23 Feb 2010, 11:49 AM
I'm not sure why that doesn't work. Have you tried using FormPanel's 'findById' instead?

nickweavers
23 Feb 2010, 11:59 AM
Yikes! I had a typo :">

Sorry... thanks for looking... need new glasses 8-|

(How does one delete a useless post they have submitted?)