MeCARTT,' J.
This is an original application for a writ of mandate against Hon. Morris L. Ritchie^ one of the district judges of Salt Lake County. The proceedings upon which the application is based are as follows: On October 31, 1908, Hyrum Neilson, the relator herein, who, for convenience, will hereafter be designated and referred to as plaintiff, commenced an action in the justice court of Salt Lake City precinct against E'. E. Watrous, H. R. Watrous, and Earl Watrous, defendants, to recover the sum óf $206 for goods, wares, and merchandise alleged to have been sold and delivered to them by plaintiff. Plaintiff caused to be issued *225out of said court a writ of attachment, which was duly served by garnishment. No summons was served on defendants or either of them. On November 6, 1908, the defendants appeared specially, and moved the court to dismiss the action on the ground that it was brought in the wrong precinct or city. In support of their motion defendants filed an affidavit in which it was alleged that the cause of action set forth in plaintiffs complaint arose in Holiday Precinct, Salt Lake County, Utah; that the defendants, and each of them, during all the times mentioned in plaintiffs complaint, have been and now are residents of Big Cottonwood Precinct, Salt Lake County; that the alleged cause of action sued on arose upon an account contracted in Holiday Precinct, which is not situated in Salt Lake City Precinct, and that during all of said times there has been, and now is, a regularly elected, qualified, and acting justice of the peace in Holiday Precinct. On November 10, 1908, the justice of the peace sustained the motion, and dismissed the action without prejudice. The plaintiff thereupon appealed the ease to the district court of Salt Lake County. On December 17, .1908, the defendants filed an answer to the merits in the district court in which they denied “each and every allegation contained in said complaint,” and prayed that “the plaintiff take nothing by his said complaint.” The same day on which the answer was filed the defendants filed a motion to dismiss the attachment on the ground that the justice court had no right to issue the writ because it had no jurisdiction of the defendants, or either of them. Two of the defendants, H. It. Watrous and Earl Watrous, filed an affidavit in support of the motion to dismiss, in which they denied each and every averment contained in plaintiff’s affidavit for attachment. The motion to dismiss the attachment was argued and submitted' and by the court taken under advisement. The court did not rule upon this motion, but, on December 31, 1908, on its own motion, dismissed the case “without prejudice to a new action” for want of jurisdiction, and refused to further entertain jurisdiction *226of the case and try tbe same upon merits. Plaintiff thereupon began these proceedings for a writ of mandate requiring the Third District Court, Hon. Morris L. Eitchie judge thereof, to vacate and set aside the order of dismissal, and to assume jurisdiction of the cause and to try upon merits, and for costs against the other defendants.
It is contended on behalf of the defendants that the judgment of the justice of the peace dismissing the action without prejudice is not a judgment from which an appeal will lie. Counsel, in their brief, say: “The judgment of the justice in this case was that the same be dismissed without prejudice, and therefore it did not dispose of the action as to all the parties, and dispose of the subject-matter of the litigation upon the merits.”
It is settled law in this jurisdiction that a judgment is final for the purpose of taking an appeal when it terminates the action or proceeding in which it is rendered, and that, too, regardless of whether or not the rights of 1 the parties with reference to the subject-matter of the action have been adjudicated. In the case of Honerine M. & M. Co. v. Tallerday S. P. & T. Co., 30 Utah 449, 85 Pac. 626, the question as to what constitutes a final judgment, within the meaning of the Constitution and statutes of this state, was discussed, and in the course of the opinion Mr. Justrice Straup, speaking for the court, said: “It is the termination of the particular action which marks the finality of the judgment. A decision which terminates the suit or puts the case out of court without an adjudication on the merits is nevertheless a final judgment.” In the case of Winnovich v. Emery, 33 Utah 345, 93 Pac. 988, this same general question as to what constitutes a final judgment was again before this court, and, in the course of the opinion, Mr. Justice Frick, after citing with approval the Honerine Case, said: “The test of finality for the purpose of an appeal, therefore, is not necessarily whether the whole matter involved in the action is concluded, but whether the particular proceeding or action is terminated by the judg-
*227ment.” Tbis doctrine was again reaffirmed by tbis court in tbe case of Bristol v. Brent, 35 Utah 213, 99 Pac. 1000.
Both tbe justice of tbe peace before whom tbe action was commenced and tbe district court to which tbe appeal was taken bad original and concurrent jurisdiction of tbe subject-matter of tbe action. In fact, tbe question of jurisdiction of tbe subject-matter is not involved. Section 3745, Comp. Laws 1907, provides that all causes appealed from the justice of tbe peace courts to tbe district court shall be beard anew in such court. It therefore necessarily follows that whatever right a party to an action may waive in tbe justice court be may also waive when tbe case is appealed to tbe district court; or be may insist upon such rights in tbe justice court and waive them in tbe district court. Therefore, whatever rights the defendants may have bad to object to tbe justice court proceeding to try 2. tbe action on merits because of 'the failure of the court to acquire jurisdiction of their persons, they could have waived.; that is, by entering a general appearance and answering to tbe merits, they would have waived whatever right they might otherwise have, bad to object to a trial before that particular justice on tbe ground that tbe action was brought in tbe wrong precinct. (White v. Railway, 25 Utah 346, 71 Pac. 593; Sanipoli v. Coal Co., 31 Utab 114, 86 Pac. 865; Kuhn v. Mount, 13 Utah 108, 44 Pac. 1036.) In 3 Cyc. 521 and 522, tbe general rule is correctly and tersely stated as follows: “If a court has jurisdiction of tbe subject-matter, a defendant, by making a general appearance, waives tbe objection that tbe venue of tbe action is wrong.” Many cases are cited in tbe footnote which illustrate and sustain tbis doctrine.
It follows from what we have said that defendants, by answering to tbe merits in tbe district court, submitted themselves to tbe jurisdiction of tbe court. In fact they did not challenge the jurisdiction of that court 3 to bear and determine tbe case on its merits, but the district court, as we have observed, dismissed tbe action on its own motion instead of proceeding to try tbe case on *228merits as it should1 have done. As heretofore stated, the question of jurisdiction of the subject-matter is not involved, and has no application in this case. We recognize the doctrine that consent cannot confer jurisdiction upon a court where, under the law, it has no authority to adjudicate upon the subject-matter of the action. But where it has jurisdiction of the subject-matter, the parties may, by entering a general appearance, subject themselves to the jurisdiction of the court, and thereby make its jurisdiction complete. And this is just what the defendants in this case did when they answered to the merits in the district court. Where, as in this case, the court has jurisdiction of the subject-matter 4 of the action, and has acquired jurisdiction of the parties thereto, and instead of proceeding to hear- and determine the case on its merits arbitrarily dismisses the action, mandamus will lie to compel the court to take jurisdiction of the cause and to try the same upon merits. (Hoffman v. Lewis, 31 Utah 179, 87 Pac. 161.)
We think the temporary writ heretofore issued ought to be made permanent. It is so- ordered. Costs of these proceedings to be taxed against defendants E. E. Watrous, H. R. Watrous, and Earl Watrous.
STRAUP, C. J., and McCARTY, J., concur.