check data validation in js