PDA

View Full Version : drop down text field



.jpg
4 Nov 2010, 7:37 AM
Hi
(this is the first of a few possible issue I have)

I have a drop down with the option for an "other" box - I want this to produce a textfield when it is selected so the viewer can fill in the space... example below...


Ext.regModel('ethnicityid', {
fields: [
{name: 'id', type: 'string'},
{name: 'title', type: 'string'}
]
});

var ethnicity = new Ext.data.JsonStore({
data : [
{ id : 'whitecaucasian', title : 'White/Caucasian'},
{ id : 'afrocarribean', title : 'Afro/Carribean'},
{ id : 'hispanic', title : 'Hispanic'},
{ id : 'eastasianoriental', title : 'East Asian/Oriental'},
{ id : 'southasianindian subcontinent', title : 'South Asian/Indian subcontinent'},
{ id : 'other', title : 'Other – please specify'}
],
model : 'ethnicityid',
autoLoad : true,
autoDestroy : true
});


{
xtype: 'select',
name : 'ethnicity',
label: 'Ethnicity',
valueField : 'id',
displayField : 'title',
store : ethnicity
}


Any help, greatly appreciated...

J