
303 S.W.2d 414 (1957)
John ANTHONY et al., Appellants,
v.
John W. CREECH et al., Appellees.
No. 6080.
Court of Civil Appeals of Texas, Beaumont.
February 7, 1957.
Rehearing Denied April 3, 1957.
*415 McAlister & Benchoff, Nacogdoches, for appellant.
McDaniel & Hunt, D. R. Taylor, Jr., Center, for appellee.
R. L. MURRAY, Chief Justice.
This is an appeal from a judgment in the district court of Shelby County, which judgment sustained the plea in abatement of the appellees, John W. Creech, et al., and dismissed the suit of the appellants, John Anthony, et al.
Appellants brought their suit in the nature of a suit for injunction and for declaratory judgment against the appellees, the County Judge and members of the Commissioners Court of Shelby County, in an effort to declare void an election held to determine whether Sardis Common School District No. 37 and Shelbyville Independent School District No. 903 should be consolidated. A temporary restraining order was issued, restraining the County Judge and the various County Commissioners from canvassing the ballots and returns of the school election held May 26, 1956, and from declaring the results thereof or ordering the consolidation of said districts. This restraining order expired on June 4, 1956, at which time the court heard the appellants' application for temporary injunction. On June 4, 1956 the appellants filed a supplemental petition making the two school districts parties to the suit. On the same date the appellees presented their plea in abatement, alleging, in substance, that the suit of the appellants was nothing more than an election contest, that the same was premature in that no notice of intent to contest the election in writing was delivered to or served upon the County Attorney of Shelby County prior to the filing of the suit, and therefore the court had no jurisdiction to hear the suit or grant the relief prayed for. The trial court sustained the plea in abatement, and allowed the appellants to amend. The appellants filed an amended petition, and the court then entered its judgment sustaining the plea in abatement and dismissing the suit. The appellants have perfected their appeal to this court for review.
The appellants bring their appeal under three points of error, contending that the court erred in sustaining the plea in abatement, because (1) the appellants stated a cause of action under the uniform declaratory judgment act, Article 2524-1, Vernon's Annotated Civil Statutes of Texas, (2) because the court thereby held that the appellants' suit was an election contest, (3) the appellants stated a cause of action entitling them to an injunction restraining the appellees from consolidating the school districts. The three points are properly presented and briefed together, since all three points are closely related to each other. We shall consider them together.
We agree with the appellants in their contention that if the petition filed with the County Judge of Shelby County, *416 praying for an election to be held to determine whether the two school districts should be consolidated, was insufficient in law to confer jurisdiction upon such County Judge to call such an election, then the entire election was void and all subsequent orders in connection with such election, such as canvassing the returns and declaring results of the election and the order consolidating the two school districts, all were void and the appellants would not be compelled by law to resort to the statutory election contest or to a quo warranto proceeding. This procedure, suit for declaratory judgment and injunction, was followed and approved by the court in Wichita Common School District No. 11 v. Dickens Independent School District of Dickens County, Tex. Civ.App., 206 S.W.2d 885. When a County Judge lacks potential jurisdiction to order an election, an election held pursuant to such an order is void. Mesquite Independent School District v. Gross, 123 Tex. 49, 67 S.W.2d 242; West End Rural High School District of Austin County v. Columbus Consolidated Independent School District of Colorado County, 148 Tex. 153, 221 S.W.2d 777. Since in the final amended petition filed by the appellants they declared outright on their proposition that the election was void because of an insufficient petition, and sought a declaratory judgment to that effect, they stated a cause of action invoking the jurisdiction of the district court of Shelby County, if they were correct in their contention that the petition filed with the County Judge, seeking the consolidation election, was insufficient at law to confer such jurisdiction upon such County Judge to call such election. West End Rural High School District v. Columbus Consolidated Independent School District, supra.
This appeal must be determined then upon the main question raised by the appellants in their lawsuit, that is, was the petition originally filed with the County Judge of Shelby County sufficient to confer upon him jurisdiction to call the school consolidation election?
Article 2806, Vernon's Ann. Civil Statutes of Texas begins as follows: "On the petition of twenty (20) or a majority of the legally qualified voters of each of several contiguous common school districts, or contiguous independent school districts, or one or more independent school districts and one or more common school districts constituting as a whole one continuous territory, praying for the consolidation of such districts for school purposes, the County Judge shall issue an order for an election to be held on the same day in each such district." According to the allegations in the petition of the appellants, the appellee John W. Creech, County Judge, received the following petition signed by 45 alleged qualified voters of the Shelbyville Independent School District No. 903, which read as follows:
"The State of Texas
"County of Shelby
"To The Honorable John W. Creech County Judge, Shelby County, Texas:
"We, the undersigned, each being qualified voters residing within the boundaries of the Shelbyville Independent School District No. 903, Shelbyville, Texas, hereby petition you to order an election in compliance with Article 2806 of Vernon's Annotated Revised Civil Statutes of the State of Texas and said election shall be for the purposes of deciding whether the Sardis Common School District No. 37 shall be consolidated with the Shelbyville Independent School District No. 903."
On the same day the said appellant John W. Creech, County Judge, received a petition signed by 77 alleged qualified voters of the Sardis Common School District No. 37, which read as follows:
"The State of Texas
"County of Shelby
"To The Honorable John W. Creech, County Judge, Shelby County, Texas:
*417 "We, the undersigned, each being qualified voters residing within the boundaries of the Sardis Common School District No. 37, hereby petition you to order an election in compliance with Article 2806, Vernon's Annotated Revised Civil Statutes of the State of Texas and said election shall be for the purpose of deciding whether the Sardis Common School District No. 37 shall be consolidated with the Shelbyville Independent School District No. 903."
The contention of the appellants is plain and forthright. The statute provides, as copied above, that the petition in such a matter shall pray for the consolidation of such districts for school purposes; the petitions presented to the County Judge here petitioned him to order an election in compliance with Article 2806, said election to be for the purpose of deciding whether the two school districts shall be consolidated. Appellants say that the precise question as to the validity of these two school petitions has been decided favorably to their contention by the Supreme Court in West End Rural High School District of Austin County v. Columbus Consolidated Independent School District of Colorado County, 148 Tex. 153, 221 S.W.2d 777. We have studied this case with great care and have concluded that it does not sustain the appellants in their contention as to the substantive law of their suit. We do believe that it sustains the appellants in their contention that they have followed the proper procedure in their application for a declaratory judgment and injunction, as we have held above in this opinion. The exact question in the instant suit, however, that is, the failure of the school petitions to pray for the consolidation of the two school districts for school purposes, was not raised in that case and such a question was not precisely before the court in that case. The defect in the petition complained of in that suit was that it did not properly name the school districts sought to be consolidated. Such defect the court held was apparent on the face of the petition and was a substantial one. The court in its opinion does not discuss or pass upon the very close question which the appellants have raised in this suit.
It must be conceded that the petitions for the consolidation of these two school districts in the instant suit did not literally comply with the wording of Article 2806, supra. The petitions petitioned the County Judge to order an election in compliance with Article 2806, which election was to be for the purposes of deciding whether the two named districts should be consolidated. According to the other provisions of said Article 2806 and the decisions of many courts in passing upon the validity of elections held thereunder, the sole duty of the County Judge, upon receiving a petition in such cases, was to decide whether the proper number of legal signers of said petition was to be found in the petition, whether the petition was regular in other respects, and then to issue an order for an election and give notice of the date of the election. After the election is held it becomes the duty of the Commissioners' Court to canvass the returns and, if the votes cast in each and all the districts show a majority in favor of such consolidation, the court should declare the school districts consolidated. If the petitions under consideration here had, in the words of the statute, prayed for consolidation of these two school districts for school purposes, the County Judge, the official to whom the petition is addressed and with whom it is filed, could not consolidate the two school districts for school purposes. All the statute authorized him to do was to call an election and give proper notice of such an election. The actual consolidation of the school districts for school purposes is required to be done by the votes of the voters in each of the two school districts and the action of the Commissioners' Court thereafter, declaring the school districts consolidated, constitutes only the official record of the consolidation, which is effected by the voters at the election. The omission of the prayer to the County Judge for the consolidation of such school districts for school purposes therefore was a mere irregularity, and did not *418 constitute a fatal defect in the petition. To have included this prayer in the petition would not have added anything to the power of the County Judge who received it, since obviously he had no power to consolidate the two school districts for school purposes. When the petitions prayed for an election to determine whether the two school districts should be consolidated and asked that the election be held in compliance with Article 2806 of the statutes, we believe the petitions showed a substantial compliance in all necessary matters with the statute. It necessarily follows, therefore, that we have concluded that the petitions filed with the County Judge and acted on by him were sufficient to confer jurisdiction upon him to call the election and the election held pursuant to said petitions, the orders of the County Judge and the notices thereunder, were not void. It also follows that since the election was not void, then the district judge was not in error in holding that the appellants' final amended petition in the district court did not state a cause of action conferring jurisdiction upon that court, and the judgment must be affirmed.

On Motion for Rehearing.
In their motion for rehearing, the appellants complain, in language which at best can be described as unrestrained, that we are in error in holding that they did not, by their petition, invoke the jurisdiction of the district court. They argue that the trial court did have jurisdiction of this suit, because "if he did not have jurisdiction, he could not act on it." We held that the trial court had jurisdiction to pass upon the pleading of the appellees; that the pleading did not allege facts showing the school consolidation election was void; and that the trial court could and did property declare its lack of jurisdiction.
If the trial court dismissed appellants' suit for an incorrect reason, "that it was just an election contest, without joinder of the County Attorney," as was urged in the plea in abatement of appellees, but the suit should have been dismissed properly for the reason that the petition stated no cause of action, the result in the trial court and in this court on appeal would have been the same. It would be a useless act here now for this court to reverse the trial court's judgment dismissing appellants' suit by sustaining the plea in abatement, remand the cause for a new trial, and hold on the next appeal that appellants did not allege a cause of action and therefore dismiss their suit. See Kelly v. Wright, Tex., 188 S.W. 2d 983, at page 986; Rule 434, Texas Rules of Civil Procedure.
Under the allegations of this petition, appellants did not allege a cause of action, for the reasons we set out in the original opinion. If we are incorrect in such holding, appellants have their remedy by writ of error to the Supreme Court in this cause.
The motion for rehearing is overruled.
