Adding javascript validation to page