STRAUP, J.
This is an appeal from a judgment of the district court granting a permanent writ of prohibition. In the petition *121for an alternative writ, the respondents, Campbell and his wife, alleged that J. I). Reavis' commenced an action in the justice court of Murray Precinct, Salt Lake County, against the Campbells to recover a commission for the sale of real estate. Summons was served on the Campbells in Salt Lake City, where they resided. They filed an affidavit in the justice court, in which it was averred by them that they, at the commencement of the action, and for two years prior thereto, were not residents of Murray Precinct, but were residents of the First Precinct of Salt Lake City, and that neither of them had made any contract with the plaintiff to perform any obligation in Murray Precinct or elsewhere. It is not made to appear that any counter affidavit was filed. The justice ruled that the affidavit filed by the Campbells was “not sufficient to oust this court of its jurisdiction and is therefore overruled.” Upon the failure of the Campbells to plead to the complaint, the justice entered their default, and, upon the evidence adduced by the plaintiff, rendered and entered a judgment against them on the 26th day of October, 1906. On the same day the Campbells filed a written notice of appeal, appealing from the judgment to the district court. The notice was not served until the 23d day of November, 1906. In October, 1907, the appeal was dismissed by the district court. A copy of the record of the justice court, and of the .proceedings had in the case before the justice, were attached to, and made a part of, the petition for the writ. It was further alleged in the petition, on information and belief, that Durand, the justice, had applied to the clerk of the district court for the money there on deposit in lieu of. a written undertaking staying proceedings on the appeal, and for a return of the papers from the district court to his court, and that, unless restrained, he would proceed to execution on the judgment. It was further averred that by the filing of the affidavit by the Campbells in the justice court that they were not residents of Murray Precinct, and that they had not contracted to there pay the obligation sued on, the justice was. deprived or ousted of *122jurisdiction to further proceed in the case and to render the judgment which was rendered by him.
In response to the alternative writ served upon him, the justice demurred to the petition for want of facts. The demurrer was overruled. He then answered, admitting the proceedings in the justice court substantially as alleged in the petition, and that an appeal had been taken by the Camp-bells from the justice court to the district court, which was dismissed. He denied that the judgment of the justice court was void; and denied the allegation in the petition that he had applied for the money in the district court, or for the papers, or that he would, unless restrained, proceed to execution on the judgment. It was further averred by him that the dismissal of the appeal in the district court constituted an affirmance of the judgment of the justice court, which judgment of dismissal was unappealed from, unreversed, and remained in full force and effect, and that the matters and things alleged and complained of in the petition for the writ were adjudged adversely to the petitioner on the appeal, and that prohibition was not the proper remedy. Upon the petitioners’ motion for judgment on the pleadings, the district court granted a permanent writ restraining the justice “from further proceedings so far as attempting to enforce the judgment or pretended judgment entered in said court, either by execution or' otherwise.” From that judgment the justice has prosecuted this appeal.
• It is not here contended by appellant that the dismissal of the appeal in the district court, adjudicated the validity of the judgment appealed from. The ground upon which the appeal was dismissed is not made to appear. Since the judgment was appealable and the appeal dismissed on motion of Eeavis, it may, however, be assumed that it was dismissed because of some default or neglect on the part of the Campbells in not properly taking or perfecting the appeal, and upon some ground provided by statute for a dismissal of an appeal.
*123But whatever may have been the grounds, it is clear that a mere dismissal of the appeal did not adjudicate the validity of the judgment appealed from. the statute provides that, when an appeal from a justice court to 1 the district court is dismissed, the judgment appealed from shall have the same force and validity, and may be enforced in the same manner, as if no appeal bad been taken. the dismissal of the appeal therefore left the judgment of the justice court with the same force and effect as though no appeal bad been taken. Any order made by the district court on a mere dismissal of any greater and different effect than that declared by the statute would be without force. What is here contended for by the appellant, and controverted by the respondents, is: (1) That prohibition was not the proper remedy, because the ease is not one involving an excess of legal jurisdiction, or a usurpation of jurisdiction, with which the justice was not vested by law; (2) that the Campbells, having bad an adequate remedy at law by appeal which was exercised by them, but rendered unavailing by their neglect or default, cannot thereafter resort to prohibition, because, to permit them to do so, is in effect to convert the writ of prohibition into a writ of review or certiorari, and to allow a defeated litigant to resort to and invoke successive remedies, first by appeal, then by prohibition, to accomplish the same purpose, the annulment of the judgment, if invalid; and (3) that the district court erred in rendering a judgment on the pleadings.
Even though all that is claimed by the respondents, on the question of remedy should be conceded, still we entertain considerable doubt as to whether the district court was justified in granting the permanent writ on the pleadings, for the reason tbat the allegation in the petition tbat the justice bad threatened or attempted to enforce or proceed upon the judgment, or tbat be was about to do so, was denied by him. the district court, in rendering judgment on the pleadings, notwithstanding the denial, evidently proceeded on the theory tbat such allegation in the petition was not essential. There may be circumstances where usurpation of jurisdiction *124Or want or excess of legal jurisdiction may be arrested by prohibition, though no attempt or threat to commit such unauthorized acts had been made.
The general rule, however, undoubtedly is that to grant prohibition it should clearly be made to- appear that the inferior tribunal or board, etc., is about to proceed in some matter over which it possesses no jurisdiction, or that it by some acts, or declarations, indicated an intention to pursue such a course. (2 Spell. Inj. and Extr. Rems. 2 (2d Ed.), section 1750.) And, as said by the California and other courts, it would seem reasonable to require that, before a judge or court should be prohibited from doing an act, it should appear that he was about to proceed or had threatened to do the act. (Lewis v. Superior Court, 11 Cal. App. 483, 105 Pac. 763.) But we are of the opinion that the remedy by prohibition was not proper. The writ of prohibition is a prerogative writ, the most extraordinary of all the writs, and is “to be used with caution and forbearance.” The proper purposes of its office or function have not always been observed, and in some instances have been confused with those of certiorari, because of the relief allowed by both against an excess of jurisdiction of the inferior tribunal or where excess of jurisdiction may be involved. And prohibition has been granted in cases where the question of remedy was not raised, and where, had it been raised, the relief, on the ground of inappropriate remedy, might probably have been denied. (Hubbard v. Justice Court, 5 Cal. App. 90, 89 Pac. 865.)
The general rule in this jurisdiction, as well as in most jurisdictions, is that prohibition will not issue where there is available to the applicant another plain, speedy, and adequate remedy in the ordinary course of law, either 3 by appeal, or writ of error or other writ of review, certiorari, injunction, or other proceeding appropriate to the relief. (32 Cyc. 613.) There and in notes to the case of State v. Superior Court, 111 Am. St. Rep. 929, may be found a discussion and a collection of cases bearing upon the question of remedy by prohibition.
*125But our court in the case of State ex rel. v. Morse, 27 Utah 336, 75 Pac. 739, has very clearly, and we think correctly, defined the true office or function of the writ of prohibition to be a process by which a superior 4 court prevents an inferior court or tribunal, etc., from usurping or exercising a jurisdiction with which it has not been vested by law, and to arrest it from exercising a. want or an excess of a legal jurisdiction, and not to prevent or correct an erroneous exercise of jurisdiction. Numerous cases and authorities are there cited and reviewed supporting such views. The same doctrine is stated in 2 Spell, on Inj. and Extr. Perns. (2d Ed.), sections 1716, 1729. In the latter section it is said: “And under statutes vesting courts of common pleas inferior to the Supreme Court with supervisory and corrective as well as appellate jurisdiction over justices’ courts (and such is the ease here as provided by the Constitution-and by statute), prohibition to the latter will be refused and aggrieved parties left to pursue the remedies- provided by statute by appeal or otherwise, notwithstanding an excess of jurisdiction by justices.” The same doctrine is supported also in the case of Powelson v. Lockwood, 82 Cal. 613, 23 Pac. 143, and Hubbard v. Justice Court, supra, and other cases there referred to. The rule announced in the case of the State ex rel. v. Morse has also, been followed and applied by this .court in the case of the State ex rel. Robinson v. Justice Court, 36 Utah 93, 104 Pac. 760.
It is conceded that the justice court had jurisdiction of subject-matter, and of the person of the defendants, but the contention made is that the filing of the affidavit by them ousted the justice court of jurisdiction to further proceed in the case, except to transfer it. In the case of the State ex rel. v. Gallagher, 36 Utah 68, 104 Pac. 750, 5 it was held by this court that, under section 1, chapter 92, page 108, Sess. Laws Utah 1905, the filing of the an affidavit by a defendant, such as was filed by the C'amphells, showing that he, at the commencement of the action in the justice court, was not a resident of the precinct in which the *126action was commenced, stating bis residence to be in another precinct, and averring that he had not contracted, to pay the obligation sued on in the precinct where the action was commenced, ousted the justice of jurisdiction in the case, except to transfer it and transmit the papers to another justice, and that a judgment rendered by the justice before whom the action was commenced was, under such circumstances, void for want of jurisdiction to render it.
Now, what remedy was open to the Campbells for relief against the void judgment and against its enforcement ? They undoubtedly had a remedy by appeal. If such remedy was not availing, they had a remedy by certiorari. If neither of such remedies was availing, and if there was no appropriate method by motion to set the judgment 6 aside, the remedy by injunction was open to them. The justice court, having jurisdiction of subject-matter, and of the persons of the defendants, was vested with legal jurisdiction to hear and determine all the issues of and all questions in the case, and with which he was vested or empowered by law to hear and determine. He was empowered in such case to enter an erroneous judgment, even a void judgment, as well as a correct judgment. Of course, when the undisputed affidavit of the defendants was filed, it was his plain legal duty to transfer the case. He had no discretion to refuse to transfer it and exceeded his jurisdiction when he retained it and proceeded to a determination of it. But that act had been committed. It is manifest that the writ of prohibition cannot be employed to undo a thing already done, though done in excess of jurisdiction. Prohibition is a preventive, not a corrective, remedy. Other and appropriate remedies are provided for relief in such case.
It, however, is asserted by respondents that prohibition ought to lie to arrest threatened actions of a justice to enforce, by execution or other proceeding, a void judgment. They have not referred us to any case where it has been held that the writ may properly be employed for such *127purpose. They have rather assumed that the writ 7 would lie to prevent such acts for the reason alone that the judgment was void, and, too, regardless of other and appropriate remedies. There are cases, however, where it has been held that prohibition will lie to restrain the enforcement of a void judgment where there is no other remedy available to the party aggrieved. It was so held in the case of Ex parte Lyon, 60 Ala. 650, where there was no right of appeal from the judgment. So, too, in the cases of City of Charleston v. Belter, 45 W. Va. 44, 30 S. E. 152, and People ex rel. Sprague v. Fitzgerald, 15 App. Div. 539, 44 N. Y. Supp. 556, prohibition was allowed to prevent the enforcement of a void judgment, but in neither of them does it appear that the question of remedy was raised, nor was the question of other remedies alluded to. It seems that in the case of People v. House, 4 Utah 369, 10 Pac. 838, where the question of remedy was raised, it was held by a divided court that the writ was proper on the theory that neither an appeal from the judgment nor the prosecution of a proceeding by certiorari, both of which were conceded to have been availing, was adequate. It was there said that certiorari was inadequate because on such a proceeding the reviewing court could only annul and set aside the void judgment, but could not restrain the inferior court from enforcing it after it was annulled and set aside, that an appeal was not adequate because the inferior court'had no jurisdiction to render the judgment, and hence the appellate co,urt had no jurisdiction to disturb it. But in a subsequent case (Ducheneau v. Ireland, 5 Utah 108, 13 Pac. 87), the writ to prevent the enforcement of a void judgment, one rendered without jurisdiction of subject-matter, was denied because an appeal from the judgment was held to be an adequate remedy. So, also, was the writ denied in the cases of People v. Hills, 5 Utah 410, 16 Pac. 405, and Mining Co. v. McMaster, 19 Utah 177, 56 Pac. 977, on the ground that an appeal from the judgment was an adequate remedy. So, too; was it held in the eases of Mancello v. Bellrude [Cal.], 11 Pac. 501, and Tapia v. Martinez, 4 N. M. [Gild.] 329, 16 Pac. 272, that *128prohibition would not lie to prevent the enforcement of a void judgment — one rendered where the court had no jurisdiction of subject-matter, because other remedies were available. And, because other appropriate remedies generally are available, the cases are indeed rare where the enforcement of a judgment, though void, was restrained by prohibition.
Of course prohibition would lie to restrain the threatened acts of one who was not vested or empowered by law to issue executions, or of one, though empowered by law to issue executions, from issuing an execution or otherwise 8 enforcing a judgment which on appeal or other proceeding had been stayed, for such acts would amount to a clear case of usurpation of jurisdiction, or an encroachment upon another court. (High on Extr. Leg. Hems.' [3d Ed.], section 789.)
The ordinary and usual remedy employed to restrain the enforcement of a judgment, though void, where there is no appeal, writ of error, certiorari, or other writ of review, nor any appropriate method by application to- the court having rendered the judgment nor other speedy and adequate remedy at law, is not by prohibition but by injunction. (1 Black, Judgment [2d Ed.], section 37fi; 1 High Injunctions [4th Ed.], section 228; 23 Cyc. 993-994; 9 1 Spell. Injunctions Extr. Hems. [2d Ed.], sections 105, 109; 8 Am. Dig. Dee. Ed., p>. 1720.) The rule stated in Cyc. is “that equity may properly enjoin the enforcement of a judgment which is absolutely and entirely void, especially if the judgment is regular on its face and does not disclose the grounds of its invalidity. But, to obtain relief on this ground, it is necessary for the complainant to show that he has no adequate remedy at law, or .that he has exhausted his legal remedies by motion to vacate, or strike out the judgment, or by certiorari to review it. . . . A judgment void for want of jurisdiction over the person of defendant may be enjoined in equity. And the same remedy may be sought where the failure of jurisdiction was in respect to the subject-matter of the action. But the complainant has the burden of proving affirmatively the facts *129constituting want of jurisdiction and that he has not been negligent in failing to seek his remedy at law.” In 1 Spelling, section 109, the author says: “Usually the enforcement of a justice’s judgment unappealed from will not be enjoined, unless defendant, without his negligence, has been hindered by fraud or accident from availing himself of his defense. But, when a void judgment in a justice’s court is for a sum so small that no appeal or certiorari can be prosecuted to set it aside, an injunction is the only remedy.” That is but saying that where there is no appeal, or where certiorari cannot be prosecuted to set aside a void judgment, injunction is the only remedy to restrain proceedings on the judgment. Of course, even equity will not enjoin the enforcement of a void judgment where the complainant had an appropriate method by application to the court having rendered it, or a remedy by appeal or certiorari. (17 Cyc. 1170.)
Nor stronger reasons, should it be said that prohibition will not lie to restrain the enforcement of a void judgment where such remedies are open to the applicant, especially where the court rendering the judgment had jurisdiction both of subject-matter and of the person, but was ousted of jurisdiction by reason of certain proceedings had or 10 things done in the case, such as the. filing of an affidavit that the defendant was not a resident of the precinct in which the action was commenced, and had not contracted to there pay the obligation sued on. And if neither appeal nor certiorari, nor any other plain, speedy, and adequate remedy at law, was available to the applicant to prevent the enforcement of the judgment, and if they were not negligent in failing to seek their remedy at law, we do not see why injunction would not have afforded them ample relief.
Notwithstanding our opinion that prohibition was not the proper remedy, and also assuming that the district court, for the reasons suggested, erred in granting the writ on the pleadings, we nevertheless are also of the opinion that the justice was not prejudiced by the judgment of 11 the district court restraining him from enforcing, or *130proceeding upon, a judgment which is a mere nullity. No costs were taxed, and no judgment was rendered, against him, except to restrain him from enforcing or otherwise proceeding upon the void judgment. If the right still exists on motion of the justice or of either party in the case before the justice to transfer it to another justice, that right has not been affected nor disturbed by the judgment of the district court, for the reason that the judgment in very plain terms only restrained the justice “from further proceeding so far as attempting to enforce the judgment or pretended judgment entered in said (justice) court, either by execution or’otherwise.” The judgment of the justice court being a mere nullity and opfen to both direct and collateral attacks whenever and wherever it may be brought in question, the justice would not have been justified, either upon his own motion or upon the request or direction of one interested in the judgment, to issue an execution upon it, or otherwise to enforce, or to proceed on, it, though the writ of prohibition had been denied on the grounds alone that the remedy was not appropriate, or that the justice had not attempted nor threatened to enforce the judgment.
We therefore, under the circumstances, think that the justice was not prejudiced (Baird v. Justice Court, 11 Cal. App. 349, 105 Pac. 259), and that the judgment of the district court ought to be affirmed. It is so ordered.
PRICK, C. J., and McCAKTY, J., concur.