simple validation on javascript