...

View Full Version : Resolved IE refresh? repaint? whatever?



Jahren
06-19-2009, 08:13 PM
hey there

i'd like to know why when I clear a text input in IE via javascript I need to click somewhere on the screen for the change to appear?



document.getElementById("strAuteur").value="";
//This wont trigger a repaint for IE


edit : SOLUTION -> use onclick instead of onchange.

Philip M
06-19-2009, 08:42 PM
Not sure what you mean. You need to show us more (relevant) code.

This works normally.



<input type = "text" name = strAuteur" id = "strAuteur" onblur = "clearit()">

<script type = "text/javascript">
function clearit() {
document.getElementById("strAuteur").value="";
}
</script>


Quizmaster: What is the English translation of the French word voiture?
Contestant: A tree.

Jahren
06-19-2009, 08:48 PM
alright



<input type='checkbox' name='chkAuteur' id='chkAuteur' onchange='if(!this.checked)document.getElementById("strAuteur").value="";' />
<label>Auteur: </label><input type='text' name='strAuteur' id='strAuteur' />


basic code
When you uncheck the box, the text field empties itself.
FF repaints the window while IE requires me to click somewhere in the screen to repaint the input NOW without text

Philip M
06-19-2009, 09:05 PM
Use onclick and not onchange.

For some reason Internet Explorer only fires the onchange event when the checkbox loses the focus (onblur).

Jahren
06-19-2009, 09:11 PM
Wow, Not only did it fix this refreshing problem, but you also repaired my other topic whereas IE could only change the selectedIndex once!

Thanks a bundle :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum