
375 N.W.2d 146 (1985)
221 Neb. 122
John B. MAYFIELD, Appellant,
v.
Klaus HARTMANN, M.D., Superintendent, Lincoln Regional Center, Appellee.
No. 85-171.
Supreme Court of Nebraska.
October 25, 1985.
*147 Duane L. Nelson, Lincoln, for appellant.
Robert M. Spire, Atty. Gen., and Jill Gradwohl, Lincoln, for appellee.
KRIVOSHA, C.J., and WHITE, HASTINGS, CAPORALE, SHANAHAN, and GRANT, JJ.
KRIVOSHA, Chief Justice.
John B. Mayfield filed a petition for a writ of habeas corpus in the district court for Lancaster County, Nebraska. He now *148 appeals from an order entered by the district court sustaining a motion to quash and dismiss filed by the State. In support of his appeal Mayfield has assigned nine alleged errors committed by the district court. For reasons more particularly set out herein, we believe that habeas corpus did not lie in this case and, for that reason, affirm the decision of the district court.
Mayfield's petition alleges that he is currently confined in the security unit at the Lincoln Regional Center and has been so confined since November 15, 1977, pursuant to orders entered by the Douglas County Board of Mental Health. He admits in his petition that prior to his present commitment, he had pled not guilty by reason of insanity to a charge of sexual assault in the first degree and was thereafter committed to the Lincoln Regional Center pursuant to the laws as they then existed. He further alleges that his detention is unlawful on a number of grounds: (1) That at the time of his initial trial for sexual assault, he was incompetent to stand trial; (2) That when he offered his plea of not guilty by reason of insanity, he did not realize and was not advised that such a defense could result in an indeterminate confinement in a mental institution; (3) That he was committed to the Lincoln Regional Center under the provisions of law which provided that future release decisions would be made by the Douglas County Board of Mental Health and not by a court, as now required by Neb.Rev.Stat. §§ 29-3703 et seq. (Cum. Supp.1984); (4) That he is not receiving effective and adequate treatment for mental illness; and (5) That he is not now dangerously mentally ill.
We believe that we need not address the many issues raised by Mayfield, for the simple reason that even if all of the issues raised by Mayfield were valid, a matter we do not decide, he was still not entitled to relief in the form of habeas corpus. The function of a writ of habeas corpus in Nebraska is a somewhat limited matter and may not be used as a substitute for an appeal. In Sileven v. Tesch, 212 Neb. 880, 326 N.W.2d 850 (1982), we reviewed the function of a writ of habeas corpus. We there noted at 883, 326 N.W.2d at 852:
"Where a judgment is attacked in a way other than a proceeding in the original action to have it vacated, reversed, or modified, or a proceeding in equity to prevent its enforcement, the attack is a `collateral attack.' County of Douglas v. Feenan, 146 Neb. 156, 18 N.W.2d 740 (1945); State ex rel. Southeast Rural Fire P. Dist. v. Grossman, 188 Neb. 424, 197 N.W.2d 398 (1972). Only a void judgment is subject to collateral attack. Stanton v. Stanton, 146 Neb. 71, 18 N.W.2d 654 (1945); Davis Management, Inc. v. Sanitary & Improvement Dist. No. 276, 204 Neb. 316, 282 N.W.2d 576 (1979)."
We went on further in Sileven, supra at 884, 326 N.W.2d at 852-53, to note:
"It is well settled that where the court has jurisdiction of the parties and the subject matter, its judgment is not subject to collateral attack. State ex rel. Southeast Rural Fire P. Dist., supra

....
"We have recognized the distinction between want of jurisdiction and error in the exercise of jurisdiction. ` "Where jurisdiction has once attached, mere errors or irregularities in the proceedings, however grave, although they may render the judgment erroneous and subject to be set aside in a proper proceeding for that purpose, will not render the judgment void, and until set aside it is valid and binding for all purposes and cannot be collaterally attacked."'"
We then concluded in Sileven, supra at 884, 326 N.W.2d at 853, by saying: "It has long been the rule in this jurisdiction that habeas corpus is a collateral proceeding and as such cannot be used as a substitute for an appeal or proceedings in error." (Citations omitted.) To the same effect, see, Piercy v. Parratt, 202 Neb. 102, 273 N.W.2d 689 (1979); Schleuter v. McCuiston, 203 Neb. 101, 277 N.W.2d 667 (1979); State ex rel. Casselman v. Macken, 194 Neb. 806, 235 N.W.2d 867 (1975).
*149 Mayfield makes no claim that the Douglas County Board of Mental Health, which initially caused him to be placed in the custody of the Lincoln Regional Center, or the district court for Douglas County, Nebraska, which has now acquired jurisdiction over his person pursuant to § 29-3703, is either now without jurisdiction or was without jurisdiction when the order was entered. He maintains that § 29-3703, as applied to him, violates his constitutional rights because the new law amended the statutory scheme regulating how and in what manner people such as Mayfield could be released from custody. However, while he makes that claim, he has not in any manner sought to have the act declared unconstitutional, and until such action is taken the law is presumed to be constitutional.
We do not mean to imply that we are passing on the validity of § 29-3703 by anything we say here. Yet, even if it can be argued that the statute does violate some constitutional principle, it is still not subject to collateral attack. We have repeatedly held that to release a person from a sentence of imprisonment by habeas corpus, it must appear that the sentence was absolutely void. See, Sileven v. Tesch, supra; Piercy v. Parratt, supra. As noted by this court in Norlanco, Inc. v. County of Madison, 186 Neb. 100, 107, 181 N.W.2d 119, 123 (1970), "A statute is presumed to be constitutional and a judgment entered on an unconstitutional statute is not absolutely void but is voidable only."
Mayfield argues that cases to that effect have all involved criminal matters and therefore have no application in a case such as the present one. While it is true that Mayfield is now being held pursuant to civil commitment growing out of a criminal action, it does not change the rules with regard to whether his confinement can be collaterally attacked by habeas corpus. We have not so limited habeas corpus and have uniformly applied the rules in both civil and criminal cases alike. In State ex rel. Casselman v. Macken, supra, plaintiffs sought a writ of habeas corpus to obtain the return of their son who had been placed in a foster home by order of a juvenile court, a situation not dissimilar to the instant case. In affirming the district court's denial of the writ, we said at 194 Neb. 809, 235 N.W.2d at 869:
A judgment or dispositive order of a juvenile court is supported by the usual presumptions of validity and regularity. The proceedings leading to a final judgment or order in the juvenile court cannot be inquired into on a collateral attack such as habeas corpus but are assailable only in a direct proceeding. A collateral attack upon a judgment will not lie unless the judgment is absolutely void. Where the court has jurisdiction of the parties and the subject matter, its judgment is not subject to collateral attack because the judgment is only voidable and not void.
And again, in Schleuter v. McCuiston, 203 Neb. 101, 277 N.W.2d 667 (1979), we affirmed the action of the district court which denied a writ of habeas corpus filed when petitioner sought the release of her minor child allegedly being held unlawfully and forcibly by others. In so doing we noted at 106, 277 N.W.2d at 670: "[T]he writ of habeas corpus is not a corrective remedy and is not a substitute for appeal or proceedings in error." See, also, Sedlacek v. Hann, 156 Neb. 340, 56 N.W.2d 138 (1952).
Mayfield is not without remedy. There are, obviously, a host of avenues available to him to test the various matters which he now raises. It is, however, clear that habeas corpus is not one of those available remedies and therefore not an appropriate vehicle by which to raise the issues contained in his brief. For that reason alone the trial court was correct in sustaining the State's motion to quash and dismissing the petition seeking a writ of habeas corpus. The judgment of the district court is therefore affirmed.
AFFIRMED.
BOSLAUGH, J., participating on briefs.
