Opinion by
Judge Doyle,This is an appeal by Jay Kielstock, Jerome Green, Lawrence Chosed, and Myles Gordon (Appellants) from orders of the Court of Common Pleas of Philadelphia County which struck their names from the primary election ballot for the office of Democratic Ward Execu*155tive Committee of the Sixty-Third (63rd) Ward.1 We affirm.
Appellants filed nomination petitions for the office of Democratic Committeeperson in the 63rd Ward in the City of Philadelphia. There is no dispute that the petitions were timely filed, properly executed, and contained sufficient valid signatures. Appellees, Marie Levy, Herman J. Kusselson, George Galyo and Randi Fox filed petitions in the Court of Common Pleas of Philadelphia County to set aside Appellants’ nomination of petitions.2
Following a hearing on February 14, 1984 before the Honorable Thomas A. White, the court of common pleas, on February 15, 1984, entered orders directing the Appellants’ names be removed from the primary ballot, holding that they were ineligible, under Rule 1, Article 3 of the Rules of the Democratic Party of the City of Philadelphia, for the office sought.
Rule 1, Article 3 of the Rules of the . Democratic Party of Philadelphia County provides, in pertinent part:
No person shall be qualified for membership in any organization or committee under these rules *156... who has within a two year period actively or inactively supported the candidacy at any general election of any person or persons not on the Democratic ticket.
The record evidence is uncontroverted that within the previous two years, Appellants actively supported the candidacy of non-Democratic nominees in the 1982 and/ or 1983 general election.3
Before this Court, Appellants contend that the court of common pleas violated the constitutional rights of Appellants in setting aside their nomination petitions.
Appellants urge that the court of common pleas had no authority to set aside the nomination petitions outside of the criteria enumerated in Sections 807, 812, 976, and 977 of the Election Code,4 25 P.S. §§2837, 2842, 2936 and 2937. Appellants argue that the grounds set forth by the court of common pleas, i.e. ineligibility of the candidates under the party rules, are not within the statutory criteria. We disagree.
Section 977 of the Election Code, 25 P.S. §2937, provides, in pertinent part:
*157If the court shall find that said nomination petition or paper is defective under the provisions of section 976, or does not contain a sufficient number of genuine signatures of electors entitled to sign the same under the provisions of this act, or signatures of electors entitled to sign the same under the provisions of this act, or was not filed by persons entitled to file the same, it shall be set aside. (Emphasis added.)
Section 807 of the Election Code, 25 P.S. §2837 also provides, in pertinent part:
There may be in each county a county committee for each political party within such county, the members of which shall be elected at the spring primary, or appointed, as the rules of the respective parties within the county may provide. (Emphasis added.)5
The United States Supreme Court has made clear that political parties have a right, inherent in the Constitutional protection of freedom of association under the First and Fourteenth Amendments, to determine the qualifications of those eligible for participation in party politics. See Democratic Party of the United States v. Wisconsin, 450 U.S. 107 (1981). And the Supreme Court has recognized the “ particularized legitimate purpose’ ... of preventing interparty raiding, a matter which [bears] on ‘the integrity of the electoral process.’ ” Storer v. Brown, 415 U.S. 724, 731 (1974) *158(citation omitted) (quoting Rosario v. Rockefeller, 410 U.S. 752, 761-62 (1973)). We read Section 807 of the Election Code to safeguard this important constitutional right by providing that qualifications for local party office may be determined by reasonable party rules. And Section 977 of the Code provides that the court may invalidate the nomination petitions of candidates who are not qualified. In the case at bar the court of common pleas did not exceed its statutory authority in looking to the Democratic Party rules to determine if Appellants were entitled to file the nomination petitions challenged.
Bentman v. Seventh Ward Democratic Executive Committee, 421 Pa. 188, 218 A.2d 261 (1966), on which Appellants rely, is inapposite. In Bentman, the Democratic party Executive Committee removed from office two committeemen who had been duly elected to that office in the preceding primary election for having supported an unendorsed Democratic candidate. Our Supreme Court held that protection of the rights of the electors who had voted the ousted committeemen into office required that they could not be removed from that office for activity engaged in prior to assuming office. But in the case at bar there is no attempted ouster of officers already elected but rather a challenge to the eligibility of the candidates to run. And here the offending activity is not merely the support of a Democratic candidate in the primary who was not endorsed, but rather the active support for the election of opposition party candidates in the general election. Bentman is therefore wholly distinguishable on the facts, and reliance on the case as controlling precedent is misplaced.6
*159To be sure, the electors belonging to a political party have a right to choose whom they wish to represent them in their party’s organization and councils. But the right of the party electors, as individuals, to choose their representatives must be balanced with the right of the party as an association to identify the people who constitute the association and to limit the association to those people only. Wisconsin. “Neither the right to associate nor the right to participate in political activities is absolute.” United States Civil Service Commission v. National Association of Letter Carriers, 413 U.S. 548, 567 (1973); see also Wisconsin. We believe the Democratic Party has a right in this case to protect its identity as an association by excluding from the field of choice for party office, nominees who have demonstrated allegiance to opposition candidates.
Accordingly, we affirm.
Order
And Now, this 20th day of March, 1984 after argument heard this same date, the orders of the Court of Common Pleas of Philadelphia County are hereby affirmed, and the County Board of Elections is hereby instructed not to include the following named persons on the primary ballot to be held on April 10, 1984 for Democratic Ward Executive Committee in the 63rd Ward of the City of Philadelphia: JAY KIELSTOCK, JEROME GREEN, LAWRENCE CHOSED and MYLES GORDON. Opinion to follow.
The court of common pleas entered separate orders in each of the four Appellants’ cases (see footnote 2, infra). The cases were consolidated for appeal.
Marie Levy challenged the nomination petition of Jay Kiel-stock; Herman J. Kusselson challenged the nomination petition of Jerome Green; George Galyo challenged the nomination petition of Lawrence Chosed; and Randi Fox challenged the nomination petition of Myles Gordon.
Before the court of common pleas, Appellants challenged the standing of the objectors. It was argued that the Democratic Party was the proper entity to invoke its rules to challenge the nomination petitions. We note that this Court has set forth broad criteria governing standing to challenge nomination petitions in Appeal of Robert C. Barlip, 59 Pa. Commonwealth Ct. 178, 428 A.2d 1058 (1981). In any event, the standing issue is not raised on appeal and we therefore need not address it.
The record contains no testimony regarding the activity of Jerome Green. It does, however, indicate that at the hearing before the court of common pleas, counsel for Green orally stipulated that the evidence would show that Green had engaged in the alleged activity prohibited by the party rule.
The evidence indicated that each of the Appellants had worked their polling place in support of Republican candidates against Democratic candidates in the 1982 and/or 1983 general elections. The evidence included sample ballots circulated by the Appellants which urged the election of Republican candidates for Mayor, Controller, District Councilman, and Councilman at Large. Testimony offered in the case of Kielstock and stipulated to in the case of Green indicated that both identified themselves to . voters as the Democratic committeeperson for their division and asked voters to support Republican candidates.
Act of June 3, 1937, P.L. 1333, as amended.
Section 807 also provides that “[n]o such rules shall be effective until a certified copy thereof has been filed in the office of the county board of elections.” At oral argument, counsel for.Appellants averred that the rule invoked by objectors and the court of common pleas was not filed in accordance with the Code. Such an allegation, however, is in the nature of an affirmative defense and was not raised before the court of common pleas. It cannot now be raised on appeal.
Our Supreme Courts recent decision in Nomination Petition of Roxanne Jones, 505 Pa. 50, 476 A.2d 1287 (1984) is similarly inapplicable. In that case, the Court found judicial inquiry into the residency of a candidate for the Pennsylvania Senate to be barred *159by constitutional separation of powers. The Court held that exclusive jurisdiction for the testing of standing qualifications for membership in the Senate and House of Representatives is conferred upon the legislative body itself. No such constitutional prohibition bars inquiry by the courts into the qualification of other candidates under the Election Code, and the limited holding in Jones does not extend to govern the case at bar.