Is it possible to check if an is valid? I want to check if it's valid to do something with javascript when it isn't. Thanks