Search code examples
javascripthtmlcssonbluronfocus

Textbox image missing after re-focus


May i know how can i remain the text box image when the textbox is re-focus ? the textbox was validated which when user no fill up the value in the textbox it will appear error message and start focus on the textbox. Unfortunately after the textbox is re-focus the image is missing. Please help check my following demo with my current coding. Any help would be appreciated.

Example : JsFiddle DEMO 1


Solution

  • In your error_function you're overriding the input background property. You should use backgroundColor property:

    document.getElementById(ID).style.backgroundColor           = "#FDEBEB";