
The opinion of the court was delivered by
Hoyt, J.
A demurrer to plaintiffs’ complaint was sustained by the court, whereupon the plaintiffs, instead of filing an amended complaint, filed with the clerk a motion to dismiss the action. Pending the action of the court upon such motion, defendants moved the court for a judgment upon the pleadings. The court denied the motion on the part of plaintiffs, and granted the one made by the defendants. Plaintiffs have appealed from the judgment so rendered, and here argued— (1) The question as to whether or not the demurrer to their complaint was properly sustained;’ and (2), as to whether or not the court committed error in denying their motion to dismiss and granting the motion for judgment made by defendants.
The plaintiffs are not in a position to raise the first question. Instead of standing upon their complaint, and allowing judgment to be entered against them, and appealing therefrom, they entered a motion to dismiss the action, and having elected so to do must be held to have waived any error growing out of the action of the court in ruling upon said demurrer. The action of the court in ruling upon the motions filed by the respective parties was in our opinion erroneous. The plaintiffs had an absolute right to have their action dismissed when they filed their motion therefor. See § 409, Code of Procedure.
It is possible that the judgment entered at the instance of the defendants would have no greater force than would one of dismissal upon motion of plaintiffs, yet the judgment entered should be reversed, and the cause remanded with instructions to grant the motion of the plaintiffs, for the *409reason that such a course may be necessary to protect rights which they were entitled to have protected by a dismissal at their instance. The court refused them a right given them by the statute, and it will be presumed that such action ivas prejudicial unless the contrary affirmatively appears.
Dunbar, C. J., and Stiles, Scott and Anders, JJ., concur.
