On Blur field text field action not working immediately
Hey thanks for reading.
I have a text field that runs javascripts On Focus and On Blur. On Focus, the field is cleared and reset in specific ways. On Blur, if the text field is not filled, the field displays the default value.
The problem:
When the user Blurs (when user clicks off the field) nothing happens, the field stays blank. The effect only runs if the user clicks off a second time. This 'delay' does not always happen either. Which makes me even more confused, and suggests there is a bug?
Any ideas how to stop this? The problem is magnified when i have other codes that go into effect when, e.g., a field is left blank.
//On focus://
event.target.strokeColor = ["RGB",0.863,0.863,0.863]; event.target.borderStyle = border.u; if (event.target.value==event.target.defaultValue) { event.target.value = ""; event.target.textColor = color.black; }
//on blur://
if (event.target.value=="") { event.target.value = event.target.defaultValue; event.target.textColor = color.ltGray; }
