jcouyang / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

goog.ui.LabelInput don't display label after reset form in IE browsers #520

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
goog.ui.LabelInput doesn't display label after reset form in IE browsers(7,8,9).

<form name="formName" method="post" id="formId">
    Number: <input type="text" name="number_text" id="inputNumberId"/>
    <input type="reset" value="Reset!"><br/>
</form>

closure code:
new 
goog.ui.LabelInput('watermark').decorate(goog.dom.getElement('inputNumberId'));

In IE browsers after reset form, stay input empty without any text.
In other browsers, label is displayed in input field.

for compile I use plovr plovr-eba786b34df9.jar 
Closure Library synced to 2143

Original issue reported on code.google.com by beranek....@gmail.com on 11 Dec 2012 at 7:52

GoogleCodeExporter commented 9 years ago
Workaround:

you must call focus and blur event of input field in onreset event of form.

var el = goog.dom.getElement('inputNumberId');
el.focus();
el.blur();

Original comment by beranek....@gmail.com on 12 Dec 2012 at 10:09