PDA

View Full Version : IE8 focus event issue



daitam
11 Oct 2012, 8:56 PM
Hello, I have problems with IE8 and Opera not reacting to focus event, when clicking on TextArea. Chrome and FF behaves as expected. Here is the code:

this.txtValue = "Blank textarea...";
this.txtValue2 = "Blank textarea2...";
this.txtCoords = new Ext.form.TextArea({
id: "txtCoords",
value: this.txtValue,
listeners: {
scope: this,
focus: function(){
if(this.txtCoords.getValue() == this.txtValue || this.txtCoords.getValue() == this.txtValue2){
this.txtCoords.setValue("");
Ext.getCmp("txtCoordsId").getEl().dom.style.color = 'black';
};
},
blur: function(){
if(this.txtCoords.getValue() == ""){
if(this.cmbKoordTipas.getValue() == "g1"){
this.txtCoords.setValue(this.txtValue);
Ext.getCmp("txtCoordsId").getEl().dom.style.color = 'grey';
}else{
this.txtCoords.setValue(this.txtValue2);
Ext.getCmp("txtCoordsId").getEl().dom.style.color = 'grey';
}
}
}
},
style: "font-size:11px; color:grey;"
});

I'm making a replacement for emptyText, because I need to dynamically change TextArea's value when it's empty. EmptyText submits to the server ant that is not that I want :) I appreciate any help on this issue. Maybe I should be using another event?
p.s. Blur works fine.

daitam
14 Oct 2012, 9:24 PM
Anyone?:)

mitchellsimoens
15 Oct 2012, 5:19 AM
So the focus event is not firing? A quick test with IE8 I get the focus event firing for me using 3.4.1

daitam
15 Oct 2012, 5:21 AM
Maybe more than one focus events fires? Any way to delay focus event when focusing?