
21 Cal.Rptr.3d 773 (2004)
124 Cal.App.4th 951
Thomas J. McKINNEY, Petitioner,
v.
The SUPERIOR COURT of San Diego County, Respondent;
City of San Diego, et al., Real Party In Interest.
No. G034762.
Court of Appeal, Fourth District, Division Three.
December 7, 2004.
Review Denied January 12, 2005.
*774 John W. Howard, San Diego, Thomas J. McKinney; Neil, Dymott, Brown, Frank & Harrison, Michael I. Neil, San Diego, and James E. Gallegos for Petitioner.
No appearance for Respondent.
Casey Gwinn, City Attorney, Anita M. Noone, Assistant City Attorney and James M. Chapin, Senior Deputy City Attorney, for Real Parties in Interest City of San Diego and Charles Abdelnour.
Robert P. Ottilie, San Diego, for Real Party in Interest Dick Murphy.
Coast Law Group, Rory R. Wicks, San Diego, and Marco A. Gonzalez, Coral Gable, FL, for Real Party in Interest Donna Frye.
John J. Sansone, County Counsel, and Timothy M. Barry, Senior Deputy County Counsel, for Real Parties in Interest County of San Diego and Sally McPherson.
Baker & Hostetler and Jack I. Samet, Los Angeles, for Amicus Curiae Lawrence W. Stirling.
Strumwasser & Woocher, Michael J. Strumwasser, Frederic D. Woocher, Gregory G. Luke and Aimee Dudovitz for Amici Curiae Martha Ready and John T. Ready.
John Witt, San Diego, for Amicus Curiae John Witt.

OPINION
SILLS, P.J.

I. Introduction

California statutory law enumerates seven specific grounds by which the results of an election can be contested (see Elec. Code, § 16100[1]) so that, under certain circumstances, the election can be set aside and a new election held.[2] California case *775 law holds that these seven grounds are the exclusive statutory grounds for post-election 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 post-election 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.

II. 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 *776 that it held San Diego couldn't preclude write-ins, it follows that the city clerk, in qualifying Frye as a write-in candidate, 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 least 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. Post-Election 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: *777 "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 postelection 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, 128 Cal.Rptr. 133 [statute allowing for "correcting ballot errors" contemplates action "which obviously must be done before the election"].)
The bases for a post-election 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, 105 Cal.Rptr.2d 214, 19 P.3d 567, 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, 105 Cal.Rptr.2d 214, 19 P.3d 567;[8]*778 see also Bradley v. Perrodin, supra 106 Cal.App.4th at p. 1173, 131 Cal.Rptr.2d 402 ["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, 131 Cal.Rptr.2d 274 [rejecting arguments that attack on impartial analysis in ballot could be brought post-election 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]
At 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 pre-election, 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 "non enumerated 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, 261 Cal.Rptr. 108, italics added; see also People ex rel. Kerr v. County of Orange, supra, 106 Cal. App.4th at pp. 931-934, 131 Cal.Rptr.2d 274 [because pre-election 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 *779 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." (Id. at p. 775, 261 Cal.Rptr. 108.)
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.
First 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 post-election 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, 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.
We discharge the stay of the certification we issued on Tuesday, November 30. Each party shall bear his or her costs in this proceeding.
WE CONCUR: RYLAARSDAM and O'LEARY, JJ.
NOTES
[1]  All nonspecific statutory references in this opinion are to the Elections Code. Section 16100 provides:

"Any elector of a county, city, or of any political subdivision of either may contest any election held therein, for any of the following causes:
"(a) That the precinct board or any member thereof was guilty of malconduct.
"(b) That the person who has been declared elected to an office was not, at the time of the election, eligible for that office.
"(c) That the defendant has given to any elector or member of a precinct board any bribe or reward, or has offered any bribe or reward for the purpose of procuring his election, or has committed any other offense against the elective franchise defined in Division 18 (commencing with Section 18000).
"(d) That illegal votes were cast.
"(e) That eligible voters who attempted to vote in accordance with the laws of the state were denied their right to vote.
"(f) That the precinct board in conducting the election or in canvassing the returns, made errors sufficient to change the result of the election as to any person who has been declared elected.
"(g) That there was error in the vote-counting programs or summation of ballot counts."
[2]  E.g., Bradley v. Perrodin (2003) 106 Cal. App.4th 1153, 1167, 131 Cal.Rptr.2d 402: "When an otherwise successful candidate ... is subsequently found to have committed an offense or offenses against the elective franchise, her election may be annulled even if the number of unqualified voters she fraudulently registered or the number of votes she unlawfully solicited were too few to have changed the outcome of the election."
[3]  See Friends of Sierra Madre v. City of Sierra Madre (2001) 25 Cal.4th 165, 192, 105 Cal. Rptr.2d 214, 19 P.3d 567, quoted later in the opinion.
[4]  A formulation which is even more restrictive than the one in San Francisco's Charter analyzed in Edelstein; the phrase "only candidates" was not to be found in the charter provision construed there. (See Edelstein, supra, 29 Cal.4th at p. 169, fn. 2, 126 Cal. Rptr.2d 727, 56 P.3d 1029.)
[5]  Procedurally we have a case with a signed order of dismissal (see Code Civ. Proc., § 581d) in which the "appellant," i.e., the petitioner here, has short-circuited the appellate process by bringing a writ petition instead of going by way of ordinary appeal. Given that the petitioner seeks the annulment of an election and the holding of a new one, it is hard to say that he has an "adequate" remedy by way of appeal. However, even if petitioner does have an adequate remedy by way of appeal, the uncertainty generated by this litigation is sufficient grounds for this court to explain its reasons for the denial of the petition instead of just denying it summarily.
[6]  Because several justices in Division One of this District to whom the case would normally be assigned, recused themselves, a panel to hear this matter in that court was unavailable.
[7]  Subdivision (a)(2) of section 13314 provides that "A peremptory writ of mandate shall issue only upon proof of both of the following: (A) that the error, omission, or neglect is in violation of this [Elections] code or the Constitution, and (B) that issuance of the writ will not substantially interfere with the conduct of the election."

Would this subdivision, restricting mandate as a remedy to violations of the either Constitution or the Elections Code, have precluded a pre-election challenge by McKinney on the theory that his challenge was strictly a matter of the city charter? No. San Diego's Municipal Code has a specific provision allowing the city clerk and city council to look to the state Elections Code "for guidance if there is no controlling provision" in the code. (San Diego Municipal Code, § 27.0106, subd. (d).) Moreover, in any event, even if McKinney could not have sought mandate pursuant to section 13314, there is absolutely nothing in the basic law of mandamus which precluded his bringing a challenge to Frye's qualification as a write-in candidate, or to the ballot being printed with a space for write-ins, before the election.
[8]  As this court noted in People ex rel. Kerr v. County of Orange (2003) 106 Cal.App.4th 914, 131 Cal.Rptr.2d 274, the Friends of Sierra Madre opinion must be considered as a whole. We said, "Plaintiffs here have not considered the full implications of the Friends of Sierra Madre decision. That decision, interestingly enough, ultimately held that the [ballot] measure being attacked was invalid because it was subject to the California Environmental Quality Act (CEQA, Pub. Resources Code, § 21000 et seq.), and in putting it on the ballot in the first place the city had not complied with the act. (See Friends of Sierra Madre, supra, 25 Cal.4th at p. 171, 105 Cal. Rptr.2d 214, 19 P.3d 567 [`We concluded that CEQA compliance is required when a project is proposed and placed on the ballot by a public agency.'].) Thus the court would say, `That plaintiffs here sought to set aside the election is not relevant.' (Id. at p. 196, 105 Cal.Rptr.2d 214, 19 P.3d 567.) [¶] Even so, when the Friends of Sierra Madre court confronted the city's argument that a postelection challenge was not permitted by the Elections Code, the court agreed. (See Friends of Sierra Madre, supra, 25 Cal.4th at pp. 191-194, 105 Cal.Rptr.2d 214, 19 P.3d 567.) The court explained for several pages that election contests are limited to `"`matters prescribed in provisions enumerating the grounds of contest.'"'" (Kerr, supra, 106 Cal.App.4th at p. 933, 131 Cal.Rptr.2d 274.)
[9]  There is no doubt that the Elections Code governs disputes even in charter cities. Article 11, section 5, subdivision (a) of our state's Constitution provides in pertinent part: "It shall be competent in any charter city to provide that the city governed thereunder may make and enforce all ordinances and regulations in respect to municipal affairs, subject only to restrictions and limitations provided in their several charters and in respect to other matters they shall be subject to general laws." (Italics added.) Moreover, the Elections Code has a number of provisions (e.g., §§ 1003, 9247) which expressly allow a charter city to have a different provision, while most provisions of the Elections Code do not expressly allow charter cities to have a different rule. That itself means something: Under the rule of expressio unius est exclusio alterius (by saying the one thing you necessarily exclude the other), absent some express allowance by the state Elections Code for a different rule in charter cities, the Legislature clearly intended the provisions of the Elections Code to govern election disputes in charter cities.
