Not really.
you may want to comment out the line:
<quote>
oField1.readOnly=true;
</quote>
you'll see that it is not relevant and the issue persist.
Main Topics
Browse All TopicsHi 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
{
oField = document.getElementById(sT
oField.value=sValue;
};
function setEllipsesOff (oField)
{
var oTR = oField.createTextRange();
oTR.select();
};
function insertValueToIdenticalInpu
{
alert();
}
function setEllipsesOn(oField1)
{
var s = oField1.value;
oField1.value="";
window.setTimeout("setElli
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
<input type='text' style="left: 0px;width: 256px; text-overflow : ellipsis" id="bb" onchange="alert()" onfocus="setEllipsesOff(th
</div>
</code>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Good question, mplungjan, maybe I should of started with the original issue all together..
I'm developing for IE6+ only, so no FF/Opera issues here.
The 'ellipsis' works on IE6 but requires the INPUT field to be "readonly", may problem is that I need the field to be editable for the user.
Example of a working input field:
<input type='text' readonly="true" style="text-overflow : ellipsis" id="cc" value="1234444444444444444
This is why I need to add the "onfocus" to change the "readonly" property of the field.
Though, this reveals yet another IE bug, if you do not reset the x.value of the element with a setTimeout method (meaning Jscript engine is refreshing the screen first), the ellipsis will not take affect even if the value is over the input size.
If I find another workaround for this, this might sovle the original issue.
Thanks.
Issue resolved.
I belive this is an IE bug. If there is onblur defect that runs before onchange and the onblur functions updates the VALUE of the element, even though the value was originally modefied by the user, the onchange will not fire.
The fix was to simulate an onchange from the onblur function:
<script>
function setEllipsesOff (oField)/* onfocus*/
{
var sState=oField.getAttribute
if (sState != "1" && oField.className != "disabled")
{
oField.readOnly=false;
var oTR = oField.createTextRange();
oTR.select();
oField.setAttribute("ellip
}
else
{
oField.setAttribute("skipO
}
document.getElementById("t
};
function setEllipsesOn(oField1) /* onblur*/
{
if (oField1.getAttribute("ski
{
oField1.removeAttribute("s
}
else
{
document.getElementById("t
var s = oField1.value;
oField1.value="";
window.setTimeout("setElli
oField1.readOnly=true;
}
};
function setEllipsesText(sTarget,sV
{
oField = document.getElementById(sT
oField.value=sValue;
var oOrigValue = oField.getAttribute("ellip
if (oOrigValue!=null && oOrigValue != oField.value)
{
onchangeBehavior(oField); //simulate onchange behavior;
oField.removeAttribute("el
}
document.getElementById("t
};
function onchangeBehavior(oField)
{
insertValueToIdenticalInpu
}
function insertValueToIdenticalInpu
{
document.getElementById("t
}
</script>
<div id="tr"></div>
<div style="left: 270px; width: 262px; top: 271px; height: 60px">
<input type='text' style="left: 0px;width: 100px; text-overflow : ellipsis" id="aa" onfocus="setEllipsesOff(th
<input type='text' style="left: 0px;width: 100px; text-overflow : ellipsis" id="bb" onfocus="setEllipsesOff(th
with State="1" : <input type='text' style="left: 0px;width: 100px; text-overflow : ellipsis;background-color:
With disabled classname: <input type='text' style="left: 0px;width: 100px; text-overflow : ellipsis;background-color:
<input type='text' readonly="true" style="left: 0px;width: 200px; text-overflow : ellipsis" id="cc" value="1234444444444444444
</div>
<form>
<input type='text' style="left: 0px;width: 200px; text-overflow : ellipsis" id="cc" value=""
onKeyUp="document.getEleme
onBlur="this.style.display
/>
<input onClick="this.style.displa
type='text' readonly="readonly" style="display:none; left: 0px;width: 200px; text-overflow : ellipsis" id="ccr" value="" />
<input type="checkbox">
</form>
Business Accounts
Answer for Membership
by: jaiganeshsrinivasanPosted on 2007-10-16 at 03:33:19ID: 20084294
after the minimize and maximize the contrls are no longer editable...so onchange does not fire.....