An element that must be present in a valid contract. If a contract has for its object an act that violates the laws of the United States or the laws of a state to which the parties are subject, it is illegal, invalid, and not recognized by the courts.