Adding js validation.