Hi all,
The below code demonstrate an odd beavior of IE (I'm working with IE6 at the moment).
The issue here is that in a specific scenario, even though a user is manually changing the contect of an INPUT field, the onchange event will not fire !
1. To recreate, paste the below code into any HTML code.
2. Focus the first input field.
3. enter whatever data (and do not tab out of the field!)
4. Lose focus from the IE window (or minimize it)
5. Open it again and lose focus of the field (or tab to the next field).
As you can see the alert() is not called !
Any suggestions as to why thiis occuring ?
Please do not comment on the code itself (readonly, ellipsis etc..) this is just a repro example.
<code>
<script>
function setEllipsesText(sTarget,sV
alue)
{
oField = document.getElementById(sT
arget);
oField.value=sValue;
};
function setEllipsesOff (oField)
{
var oTR = oField.createTextRange();
oTR.select();
};
function insertValueToIdenticalInpu
ts()
{
alert();
}
function setEllipsesOn(oField1)
{
var s = oField1.value;
oField1.value="";
window.setTimeout("setElli
psesText('
" + oField1.id + "','" + s + "')" , 0);
oField1.readOnly=true;
};
</script>
<div style="left: 270px; width: 262px; top: 271px; height: 60px">
<input type='text' style="left: 0px;width: 256px; text-overflow : ellipsis" id="aa" onchange="alert()" onfocus="setEllipsesOff(th
is)" onblur="setEllipsesOn(this
)" />
<input type='text' style="left: 0px;width: 256px; text-overflow : ellipsis" id="bb" onchange="alert()" onfocus="setEllipsesOff(th
is)" onblur="setEllipsesOn(this
)"/>
</div>
</code>
Start Free Trial