
537 So.2d 919 (1988)
Ex parte: Iris ODEM.
(Re: The CHILDREN'S HOSPITAL OF BIRMINGHAM v. Vincent KELLEY and Iris Odem).
87-403.
Supreme Court of Alabama.
July 15, 1988.
Bennett H. Webb of Legal Services Corp. of Alabama, Talladega, for petitioner.
C. Paul Davis of Sirote, Permutt, McDermott, Slepian, Friend, Friedman, Held & Apolinsky, Birmingham, for respondent.
SHORES, Justice.
We granted this petition for writ of certiorari in order to review the limited issue of whether a minor who executes a contract for a "necessary" is obligated to comply with the express terms of the entire contract, including those provisions regarding attorney fees and waiver of personal exemptions.
The facts of this case are set forth in the opinion by the Court of Civil Appeals, 537 So.2d 917, and we agree that medical services provided to an infant child of a minor are "necessaries" for which the minor parent may be obligated to pay, but we hold that the attorney fees for enforcing the *920 contract are not "necessaries" for which the minor is legally obligated to pay.
The general rule of law is that contracts of minors are voidable. That is, the contract may be avoided or ratified at the election of the minor. Flexner v. Dickerson, 72 Ala. 318 (1882). In the instant case, Iris Odem disaffirmed, or avoided, the contract she had executed with Children's Hospital. Consequently, Iris Odem's obligation to pay for necessaries, i.e., the medical services rendered to her infant son, is not the result of the express contract between the parties, but arises from a quasi-contractual relationship created by operation of law which enforces the implied contract to pay. 43 C.J.S. Infants § 180 (1978). Therefore, a minor is not liable on any portion of the contract, or for what was agreed to be paid, except that the minor is liable for the just value of the necessaries.
In Wiggins Estate Co. v. Jeffery, 246 Ala. 183, 19 So.2d 769 (1944), this Court, with approval, quoted the following from 18 Am.St.Rep. p. 650 et seq.:
"It is for the court to determine, as a matter of law, in the first place, whether the things supplied may fall within the general classes of necessaries, and if so, whether there is sufficient evidence to warrant the jury in finding that they are necessary. If either of these preliminary inquiries be decided in the negative, it is the duty of the court to nonsuit the plaintiff who seeks to recover from the [minor]. If they be decided in the affirmative, it is then for the jury to determine whether, under all the circumstances, the things furnished were actually necessary to the position and condition of the [minor], as well as their reasonable value, and whether the [minor] was already sufficiently supplied...."
Therefore, the class and character of articles that are necessaries are issues of law. Wiggins Estate Co., supra.
Do the attorney fees in this case fall within the general classes of necessaries? Stated differently, are the attorney fees necessary to the position and condition of the minor?
Under Alabama law, attorney fees are recoverable from an opposing party only when provided for by contract or by statute. Taylor v. White, 237 Ala. 630, 188 So. 232 (1939); Cincinnati Ins. Co. v. City of Talladega, 342 So.2d 331 (Ala.1977); George E. Jensen Contractor, Inc. v. Quality Mill Works, Inc., 431 So.2d 1232 (Ala.1983). Thus, any contractual provision regarding the recovery of attorney fees in this case is for the benefit of Children's Hospital, because the attorney fees would not otherwise be recoverable. Accordingly, attorney fees are not necessary to the position and condition of the minor and are not recoverable from Iris Odem.
"It is the policy of the law to protect infants against their own mistakes or improvidence, and from designs of others, and to discourage adults from contracting with an infant." 43 C.J.S. Infants § 180 (1978). Accordingly, when an infant executes a contract, the infant is liable only on his implied promise to pay for necessaries, and all other provisions of the contract are voidable at the election of the infant. Further, attorney fees are not necessaries, because they are not necessary for the position and condition of the infant. We reverse the judgment of the Court of Civil Appeals to the extent that it holds that Iris Odem is obligated under all of the terms of the contract, and we affirm that portion of the judgment that holds that she is obligated for the reasonable value of the medical services rendered to her infant son.
AFFIRMED IN PART; REVERSED IN PART; AND REMANDED.
TORBERT, C.J., and MADDOX, JONES, BEATTY, ADAMS, HOUSTON and STEAGALL, JJ., concur.
