*954Opinion
I. Introduction
California statutory law enumerates seven specific grounds by which the results of an election can be contested (see Elec. Code, § 161001) so that, under certain circumstances, the election can be set aside and a new election held.2 California case law holds that these seven grounds are the exclusive statutory grounds for postelection challenges.3 Although election results can be challenged under section 16100 on the ground that the winner is ineligible, the statute does not contemplate challenges based on the fact that one of the runners-up is ineligible.
In the case before us now, a postelection challenge has been brought on the theory that one of the losers in the election—a write-in candidate at that— was ineligible for office and her presence affected the outcome. This challenge, as we explain in more detail below, should have been brought before the election.
*955II. Background
On November 2, 2004, San Diego held a runoff election for mayor. The candidates on the ballot were the two top vote getters from the primary, Mayor Dick Murphy and County Supervisor Ron Roberts. However, about five weeks before the election the city clerk had qualified a third person as a write-in candidate, City Councilmember Donna Frye. Accordingly, the ballot also provided for write-ins.
It turned out to be a very close election indeed. Mayor Murphy and the write-in candidate, Councilmember Frye, received about 34 percent of the votes each (with Murphy apparently receiving a few more), with Supervisor Roberts receiving the rest.
We express no opinion on the issue as to whether the failure on the part of some voters who wrote in Frye’s name to also blacken an oval next to it means that those votes should, or should not, be counted. As will be made clear, the particular case before us—which is brought by a voter who wants another election without Frye on the ballot—is resolvable independent of the undarkened oval question.
The voter in question is Thomas McKinney. In the wake of the election, McKinney filed a complaint on November 8, which as amended November 12, sought declaratory and injunctive relief and an election contest. In that complaint McKinney seeks a writ of mandate which would annul the San Diego mayoral election and have the court order a new election on the theory that the qualification of Frye’s write-in candidacy by the city clerk was in contravention of San Diego’s City Charter.
The theory behind McKinney’s challenge goes like this: In 1985, the California Supreme Court in Canaan v. Abdelnour (1985) 40 Cal.3d 703 [221 Cal.Rptr. 468, 710 P.2d 268] held that San Diego could not preclude write-ins in its runoff election for mayor. However, in 2002, the California Supreme Court held in Edelstein v. City and County of San Francisco (2002) 29 Cal.4th 164 [126 Cal.Rptr.2d 727, 56 P.3d 1029] that precluding write-ins in San Francisco’s mayoral election was perfectly constitutional and even went on to overrule Canaan to the extent that it held otherwise. Since the San Diego Charter specifically says that the “only candidates” in the mayoral runoff election shall be the two top vote getters from the primary,4 and Canaan was overruled to the extent that it held San Diego couldn’t preclude write-ins, it follows that the city clerk, in qualifying Frye as a write-in *956candidate, violated the city charter’s only-candidates-will-be-the-two-top-vote-getters-in-the-primary provision, now revived in the wake of Edelstein. Moreover, even though the city municipal code was amended to allow for write-ins in mayoral runoff elections in the wake of Canaan, it is trumped by that now-revived city charter (cf. Domar Electric, Inc. v. City of Los Angeles (1994) 9 Cal.4th 161, 170 [36 Cal.Rptr.2d 521, 885 P.2d 934]).
We also do not express any opinion as to whether the qualification of Frye by the city clerk was indeed in contravention of the charter. Again, this case can be decided independent of that question as well.
An ex parte hearing was held on November 15 on McKinney’s request to obtain temporary restraining orders to halt counting the votes and prevent subsequent certification of the election results. At that hearing the trial court denied the request for the restraining order in sweeping terms, indicating that McKinney was not entitled to any relief under his complaint at all. The reporter’s transcript of the hearing shows that the trial judge rejected McKinney’s position on two bases: (1) the write-in candidacy was indeed authorized by virtue of the “custom and practice” of the city in allowing write-ins in runoff elections, but even if it wasn’t (2) McKinney had waited too long to challenge the election and his complaint was barred by laches.
A few days later, the trial judge signed a minute order dismissing McKinney’s complaint nunc pro tunc as of the date of the denial of McKinney’s request for temporary restraining orders.5
On Tuesday November 30, 2004, McKinney filed this writ proceeding in Division One of this District (based in San Diego), seeking not only to vacate the ex parte denial of his request for temporary restraining orders but also to reverse the dismissal of his case as provided in the signed minute order. The proceeding was transferred to this court (based in Santa Ana) that very day,6 which was the day that certification of the results was scheduled. We immediately stayed the certification in order to maintain the status quo at *957least long enough to study the merits of the petition and receive written opposition. We scheduled oral argument for Friday, December 3, and now write in the wake of that hearing.
III. Postelection Challenges Must Either Be Brought on Enumerated Statutory Grounds or Be Based on the Violation of Constitutional Rights
A. McKinney Should Have Brought This Challenge Before the Election
McKinney had a preelection remedy he could have exercised. Section 13314, subdivision (a)(1) provides that: “Any elector may seek a writ of mandate alleging that an error or omission has occurred, or is about to occur, in the placing of any name on, or in the printing of, a ballot, sample ballot, voter pamphlet, or other official matter, or that any neglect of duty has occurred, or is about to occur.”7
Kilbourne v. City of Carpinteria (1976) 56 Cal.App.3d 11 [128 Cal.Rptr. 133] nicely illustrates the rule that one cannot pass up a preelection remedy in favor of a postelection challenge. Kilbourne involved a special recall election of a city council member, but there was a ballot error misspelling his name. The city council member did not seek a writ of mandate until after the election was held to invalidate the election based on the ballot error. The appellate court held that the trial court lacked jurisdiction to invalidate the election because the pasTelection relief sought was not found in statute. The city council member should have sought relief preelection, as provided in the statute. (See id. at p. 16 [statute allowing for “correcting ballot errors” contemplates action “which obviously must be done before the election”].)
*958The bases for a poste lection challenge, i.e., an “election contest,” are enumerated in section 16100. And, as our Supreme Court pointed out in Friends of Sierra Madre v. City of Sierra Madre, supra, 25 Cal.4th 165, these grounds are exclusive: “That the court’s authority to invalidate an election is limited to the bases for contest specified in Elections Code section 16100 and that section is exclusive is strongly suggested by the nature of the grounds for contest therein enumerated.” (Id. at p. 192;8 see also Bradley v. Perrodin, supra, 106 Cal.App.4th at p. 1173 [“Election results may only be challenged on one of the grounds specified in section 16100.”]; People ex rel. Kerr v. County of Orange, supra, 106 Cal.App.4th 914, 932-933 [rejecting arguments that attack on impartial analysis in ballot could be brought postelection because it was not framed as an election contest]; Horwath v. City of East Palo Alto (1989) 212 Cal.App.3d 766, 775 [261 Cal.Rptr. 108] [most of the time analysis ends with determination of whether plaintiff is attacking election on one of the grounds specified for election contest in section 16100]; Alden v. Superior Court (1963) 212 Cal.App.2d 764, 768 [28 Cal.Rptr. 387] [“A proceeding to contest an election may be brought only when and as authorized by statute.”].)9
*959At oral argument counsel for McKinney specifically disavowed any reliance on section 16100, and we take that as a formal withdrawal of his complaint to the degree that it requests relief in the form of an “election contest.” Accordingly, we express no opinion here whether any of the subdivisions of section 16100 would otherwise apply to this case.
Rather, McKinney’s theory is that the court must enforce the city charter (or at least his interpretation of the charter) in terms of a request for writ of mandate. But having passed up the chance to challenge Frye’s qualification and provision in the ballot for write-ins preelection, McKinney cannot bring that challenge now, after the election. He had a remedy prior to the election if he had been willing to exercise it.
B. Any Arguable Violation of the Charter Does Not Rise to a Constitutional Level
There is only one remaining question. Friends of Sierra Madre, Horwath and Kerr all recognized that an election still might be set aside if there was malconduct that rose to constitutional levels. As Horwath framed it, the issue is whether a “nonenumerated act”—that is to say, an act not mentioned in section 16100—affects the “electoral machinery itself’ and thus renders the result unconstitutional. (Horwath v. City of East Palo Alto, supra, 212 Cal.App.3d at p. 775, italics added; see also People ex rel. Kerr v. County of Orange, supra, 106 Cal.App.4th at pp. 931-934 [because preelection challenge to ballot measure to ballot statement was not brought, court tested postelection challenge to see if asserted deficiencies rose to constitutional level].) The Horwath court summed up the proper approach in this area: “Under most circumstances, our analysis would end with the conclusion that appellants are not entitled to relief because they cannot maintain a statutory election contest. However, we do not think section 20021 [now section 16100] could foreclose a prohibitory mandamus action, even by a nonelector, if a nonenumerated act alleged in the petition and affecting the electoral machinery itself rendered the resulting enactment unconstitutional.” (212 Cal.App.3d at p. 775.)
Do the facts that Frye was “qualified” by the city clerk as a write-in candidate and there was a space on the ballot for write-in candidates, in arguable violation of the city charter, rise to such a constitutional level? We think not.
*960First of all, the fact that a ballot contains the names of candidates who are otherwise not qualified to serve was not considered by our Legislature to be a ground for setting aside an election when it enacted section 16100—how much less so did the Legislature consider the mere qualification of a candidate in arguable contravention of a local charter to be such a ground. Only if an ineligible candidate is declared the winner may a postelection challenge be brought.
Any other rule threatens to undermine the stability of most elections: If any candidate on the ballot was ineligible (and therefore supposedly drew votes away from eligible candidates), the election could be annulled despite the fact that the statute does not provide for contests based on the ineligibility of losers. The Legislature drew the line at the winner.
The other reason is more basic, but again centers on the need for stability in elections. (Cf. Gooch v. Hendrix (1993) 5 Cal.4th 266, 277 [19 Cal.Rptr.2d 712, 19 Cal.Rptr.2d 712, 851 P.2d 1321] [stressing need to validate elections if possible].) There is no doubt that in this case any arguable violation of the charter was discoverable preelection. Now, McKinney’s answer to this point is that he, like most voters, was not aware of the city charter provision which (again we do not decide the issue) precluded any write-in candidates. But that is an untenable rule. It means that voters can close their eyes and not check an election for irregularities—here, for example, apparent with the mailing of the sample ballot—and wait to see if the ineligible candidate has an effect on the outcome. (See Soules v. Kauaians Nukolii Campaign Committee (9th Cir. 1988) 849 F.2d 1176, 1182 [applying laches in Hawaiian case where appellants sought federal overturning of state election because of the importance of requiring preelection challenges to prevent “sandbagging on the part of wily plaintiffs”].) To adopt McKinney’s position would seriously destabilize California election law, which has the advantage of specifically encouraging preelection challenges precisely in order to avoid this sort of instability.
IV. Conclusions
The trial court’s minute order dismissing McKinney’s challenge is affirmed, or, to be precise, we deny the petition seeking a writ ordering the vacation of that order.
*961We discharge the stay of the certification we issued on Tuesday, November 30. Each party shall bear his or her costs in this proceeding.
Rylaarsdam, J., and O’Leary, J., concurred.
Petitioner’s petition for review by the Supreme Court was denied January 12, 2005.