Adding javascript validation.