delivered the opinion of the court:
Dennis A. Bergstrand (plaintiff) and Marilyn C. Bergstrand are the divorced parents of four school-age children. Marilyn Bergstrand, the custodial mother, wants the children to participate in sex education and disease instruction courses which are offered by the children’s school. The plaintiff, the children’s natural father, submitted written objections to the Rock Island school board, School District No. 41, protesting the children’s enrollment in these classes. Despite the plaintiff’s objections, the school board still required the children to participate in the classes because the children’s mother wanted the children to receive sex education and disease instruction. The plaintiff filed a complaint requesting that a temporary restraining order, preliminary injunction and permanent injunction issue against the school board. The cause came on for hearing upon the plaintiff’s request for a preliminary injunction. The circuit court of Rock Island County denied the plaintiff’s request on the ground that the mother and children were necessary parties to the suit. The plaintiff then took this interlocutory appeal. The sole issue on appeal is whether the mother and four children are necessary parties to the action.
The plaintiff’s written objections are submitted pursuant to the following sections of the Illinois School Code:
“Sex education. No pupil shall be required to take or participate in any class or course in comprehensive sex education if his parent or guardian submits written objection thereto, and refusal to take or participate in such course or program shall not be reason for suspension or expulsion of such pupil. Nothing in this Section prohibits instruction in sanitation, hygiene or traditional courses in biology.” (Ill. Rev. Stat. 1985, ch. 122, par. 27 — 9.1.)
“No pupil shall be required to take or participate in instruction on diseases if a parent or guardian files written objection thereto on constitutional grounds, and refusal to take or participate in such instruction on such grounds shall not be reason for suspension or expulsion of such pupil. Nothing in this act *182shall prohibit instruction in sanitation and hygiene.” Ill. Rev. Stat. 1985, ch. 122, par. 27 — 11.
Under fundamental principles of due process, a court is without jurisdiction to enter an order or judgment which affects a right or interest of someone not before the court. (Feen v. Ray (1985), 109 Ill. 2d 339, 487 N.E.2d 619.) The courts have established a test for determining a necessary party:
“A necessary party is one whose presence in the suit is required for any of three reasons: (1) to protect an interest which the absentee has in the subject matter of the controversy which would be materially affected by a judgment entered in his absence [citations]; (2) to reach a decision which will protect the interests of those who are before the court [citations]; or (3) to enable the court to make a complete determination of the controversy.” (Burt v. Board of Education (1985), 132 Ill. App. 3d 393, 395-96, 477 N.E.2d 247.)
The interest involved must be a substantial legal or beneficial interest of a direct rather than a general nature. Rubin v. Boorstein (1979), 73 Ill. App. 3d 689, 392 N.E.2d 919.
The statute at issue has yet to be interpreted by a court in a similar situation. Although a number of States have similar statutes, we have been unable to locate a similar factual situation interpreting these provisions. (See Alabama’s, California’s, and Michigan’s annotated statutes.) Consequently, it is necessary to analyze similar situations involving parental rights concerning minor children in order to determine whether Mrs. Bergstrand is a necessary party.
Under the plaintiff’s interpretation of the statute, an objecting parent in a two-parent family could decide which courses his children would be enrolled in without consulting his wife, the children’s natural mother. Clearly, a natural mother of minor children in a family setting has an interest in which classes her children will be enrolled. Free personal choice in matters involving family life is a fundamental liberty interest of a parent (Santosky v. Kramer (1982), 455 U.S. 745, 71 L. Ed. 2d 599, 102 S. Ct. 1388), because the parents’ claim to authority in their own household to direct the rearing of their children is basic in the structure of our society. (Ginsberg v. New York (1968), 390 U.S. 629, 20 L. Ed. 2d 195, 88 S. Ct. 1274.) Further, a nonobjecting parent has the right to know the basis of the complaining parent’s objection. An objecting parent must act in good faith when seeking to have his children precluded from attending educational classes. Thus, a nonobjecting parent has an interest in the controversy simply to assure that an objection was not made erroneously, *183including instances of bad faith, incompetence, duress, compulsion, and harassment.
A reading of the statute illustrates that it does not contemplate every situation that could arise. Thus, a practical decision is required. A decision incorporating the plaintiff’s reasoning would result in illogical proceedings. For example, under the plaintiff’s interpretation, a parent of a child who has shown no interest in the child since birth would be allowed to file an objection to a child’s attendance in sex education classes. Such a decision would circumvent the rights of a child’s guardian. Clearly, a practical reading of the statute would not allow such a result.
In the instant case, the Bergstrands are divorced. The Illinois Marriage and Dissolution of Marriage Act provides:
“(a) To promote amicable settlement of disputes between parties to a marriage attendant upon the dissolution of their marriage, the parties may enter into a written or oral [separation] agreement containing provisions for disposition of any property owned by either of them, maintenance of either of them and support, custody and visitation of their children. * * *
(e) Terms of the agreement set forth in the judgment are enforceable by all remedies available for enforcement of a judgment, including contempt, and are enforceable as contract terms.” Ill. Rev. Stat. 1985, ch. 40, pars. 502(a), (e).
The parties entered into a written divorce agreement with regard to the custody of their children. The agreement provides as follows:
“Petitioner, (Marilyn Bergstrand) is granted sole care, custody and control of the six minor children of the marriage, subject, however, to joint control with Respondent, (Dennis Bergstrand) as to their education.”
Based upon the divorce agreement, both parties have enforceable contractual parental rights with regard to the children’s education. A court is without jurisdiction to enter an order or a judgment which affects a right or interest of someone not before the court. (Feen v. Ray (1985), 109 Ill. 2d 339, 487 N.E.2d 619.) Pursuant to the enforceable divorce agreement, Marilyn Bergstrand has a legally enforceable right to consider the type of classes her children will attend. If she is not consulted in determining which courses her children will attend, her rights will be materially affected. Consequently, she has satisfied the test for being a necessary party enunciated in Burt v. Board, noted above.
A reading of the statute illustrates that it does not contemplate *184the situation at issue. The pupils’ parents are divorced and the custodial mother wants the children to participate in the classes and the noncustodial natural father seeks to have the children barred from enrollment. Clearly the legislature could not have intended to circumvent the parental rights of the natural mother.
The trial court’s decision with regard to Marilyn Bergstrand is correct. Marilyn Bergstrand has a parental right and interest in this case. Consequently, she is a necessary party and is required to be named in the litigation.
The trial court’s decision finding the parents’ minor children to be necessary parties is incorrect. Applying the above rules and reasoning does not necessarily result in such a finding. The statute in question was designed to provide a child’s parents or guardian with an opportunity to object to their minor children receiving sex education and disease instruction courses. The children are not mentioned in the statute, and we are confident the legislature did not intend to permit minor children to decide whether they would enroll in such classes. Further, because the statute does not include them, and as a result of their age, the minor children do not have an interest in the subject matter of the controversy. Consequently, the children do not meet the requirements for being a necessary party enunciated in Burt v. Board, noted above.
For the foregoing reasons the judgment of the circuit court of Rock Island County is affirmed in part, reversed in part, and remanded for further proceedings.
Affirmed in part; reversed in part and remanded.
SCOTT, J., concurs.