PDA

View Full Version : Timing issue



TampaBay55
19 Jan 2011, 4:36 AM
Greetings:

Pleas consider the following function:


function setFieldMask(pField,pType,pLength){
Ext.Ajax.request({
url :'setfieldmask',
params :{value:pField.getValue(),type:pType,length:pLength},
success:function(responseObject){
pField.setValue(responseObject.responseText);
}
})
};
I use this code to set a custom mask on fields using the 'change' event like so:


...
fieldLabel: 'Last Name',
name : 'lastname',
width : 140,
listeners : {
change: function(){setFieldMask(this,'cap',0);}
}
I've notice that an error is thrown (rightfully so) if I change the field but close the window before tabbing through the field because the function setFieldMask can't find the passed field reference. How can I check to see if the field exists before doing a setValue()? Thanks.

tryanDLS
19 Jan 2011, 8:19 AM
Please stop reposting - thread moderation is on.