Link to home
Start Free TrialLog in
Avatar of mitesh114
mitesh114

asked on

testing if input field is empty onblur

Hi,

when a user clicks into an input field, onblur, I want to test if that field has been left blank.  Currently, I have tried
if (strString == "") but it doesn't work.  does anyone know the correct syntax to use?

Thanks

Mitesh
ASKER CERTIFIED SOLUTION
Avatar of Batalf
Batalf
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mitesh114
mitesh114

ASKER

thanks Batalf,

The problem was that just above my code, I had:
if (strString.length == 0) return false; which was preventing me from testing an empty string.