added js validation to required categories relationship.