Javascript Inline Validation Code