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

06-19-2009, 07: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?

//This wont trigger a repaint for IE

edit : SOLUTION -> use onclick instead of onchange.

Philip M
06-19-2009, 07: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() {

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

06-19-2009, 07:48 PM

<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, 08:05 PM
Use onclick and not onchange.

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

06-19-2009, 08: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 :)