Highlight and Unhighlight Form Field
Posted on 2003-03-17
Here is bobbit13's code to highlight the strError:
if(!strError || strError.length ==0)
strError = " Please enter a valid email address. ";
objValue.style.background = "#XXXXXX"; // choose color
But I would like the background to change back to #FFFFFF if the strError is corrected. I suspect the easy way to do this is to change the background back to white when the user clicks on the "ok" button of the alert, or when the user onClicks inside this text field again to correct the problem. The validation will run again and change the text field back to yellow if still incorrect.