
22 Cal.2d 263 (1943)
FRED R. SALTER, Appellant,
v.
E. W. ULRICH, Respondent.
L. A. No. 18359. 
Supreme Court of California. In Bank.  
May 27, 1943.
 Harold L. Green for Appellant.
 John A. Jorgenson for Respondent.
 GIBSON, C.J.
 This is an action to quiet title, and defendant in his answer asked that he be adjudged the owner of the property. Both parties claim from a common source, one C. A. Kassell, who in 1929 encumbered the property with a trust deed in favor of defendant to secure a promissory note. In 1931 a street improvement bond was issued to one Oswald against the property. In 1934 defendant brought suit on his promissory note without making reference in the complaint to the fact that the note was secured. Judgment was entered against Kassell and a writ of execution issued. The property was sold to defendant in 1936 in partial satisfaction of the judgment. The marshal's certificate of sale was recorded July 10, 1936, and his deed July 13, 1937. In December, 1936, between the date of the execution sale and the delivery of the deed, Oswald brought an action against Kassell to foreclose the lien of the bond. Defendant was not named or served in that action. Kassell defaulted, foreclosure was ordered, and the property was sold to Oswald on June 1, 1937. Oswald sold his certificate to plaintiff and the commissioner's deed was issued to him in 1938.
 Thereafter, plaintiff brought this action to quiet his title. The parties stipulated that the note sued on by defendant in the municipal court was secured by a trust deed. The trial court found that defendant became the owner of the property by reason of the execution proceedings, subject to the lien of plaintiff's street improvement bond, and judgment *266 was rendered accordingly. Plaintiff has appealed contending that the judgment on which defendant relies is invalid because of a failure to conform to the requirements of section 726 of the Code of Civil Procedure, which prescribes foreclosure as the one form of remedy for the recovery of a debt secured by mortgage.
 [1] It is the general rule that a domestic judgment is not subject to collateral attack unless it is void on its face. (Hamblin v. Superior Court, 195 Cal. 364 [233 P. 337, 43 A.L.R. 1509]; Burrows v. Burrows, 10 Cal.App.2d 749 [52 P.2d 606]; Texas Co. v. Bank of America, 5 Cal.2d 35 [53 P.2d 127]; Estate of Keet, 15 Cal.2d 328 [100 P.2d 1045]; Kaufmann v. California Min. & Dredging Syndicate, 16 Cal.2d 90 [104 P.2d 1038].) It has been held, however, that the rule may be waived by the parties admitting or stipulating to the facts showing a lack of jurisdiction. (Follette v. Pacific L. & P. Corp., 189 Cal. 193 [208 P. 295, 23 A.L.R. 965]; Estate of Ivory, 37 Cal.App.2d 22 [98 P.2d 761]; Hill v. City Cab etc. Co., 79 Cal. 188 [21 P. 728].) We find it unnecessary to decide whether the stipulation herein is sufficient to have this effect, since we are of the opinion that the judgment of the municipal court was not void.
 [2] It has been held that a mortgagee by his own act alone cannot waive the provisions of section 726 and sue upon the debt (Bank of Italy v. Bentley, 217 Cal. 644 [20 P.2d 940]; Western Fuel Co. v. Sanford G. Lewald Co., 190 Cal. 25 [210 P. 419]; Unger v. Goldman, 12 Cal.App.2d 129 [54 P.2d 1126]; note 27 Cal.L.Rev. 752), and that the benefits of the section cannot be waived in advance by the mortgagor (Winklemen v. Sides, 31 Cal.App.2d 387 [88 P.2d 147]); but there seems to be no clear-cut decision as to the right of the mortgagor or trustor to make a subsequent waiver, although several cases indicate that this may be done. In Martin v. Becker, 169 Cal. 301 [146 P. 665, Ann.Cas.1916D 171], after outlining the history of the changes made in the common law rule, the court said that section 726 was a natural corollary to those changes, and was intended to simplify procedure and to relieve the mortgagor, who was usually the primary debtor, from harassment in repeated litigation. It was also said that this protection, being clearly designed for the benefit of the primary debtor, is one which he can waive. Similar expressions are to be found in Murphy v. Hellman Commercial etc. Bank, 43 Cal.App. 579 [185 P. 485], and Bank of Italy v. Bentley, 217 Cal. 644 [20 P.2d 940]. *267
 Since necessity often drives debtors to make ruinous concessions when a loan is needed, section 726 should be applied to protect them and to prevent a waiver in advance. This reasoning, however, does not apply after the loan is made, when all rights have been established and there remains only the enforcement of those rights. The situation is analogous to the right of redemption which may not be waived in advance. (Civ. Code,  2889; Bradbury v. Davenport, 114 Cal. 593 [46 P. 1062, 55 Am.St.Rep. 92]; Goodenow v. Ewer, 16 Cal. 461 [76 Am.Dec. 540].) However, the mortgagor may subsequently deed the property to the mortgagee or may release or sell the right of redemption. (Archer v. Salinas City, 93 Cal. 43 [28 P. 839, 16 L.R.A. 145]; Watson v. Edwards, 105 Cal. 70 [38 P. 527]; Clarke v. Fast, 128 Cal. 422 [61 P. 72]; Graves v. Arizona Central Bank, 205 Cal. 715 [272 P. 1063]; Bradbury v. Davenport, supra.)
 The rule against waivers in advance has been codified by section 2953 of the Civil Code, which was adopted in 1937. This section declares to be void and unenforceable "Any agreement exacted from a borrower as a condition to the making or renewing of any loan secured by a deed of trust, mortgage or other lien ... whereby the borrower agrees to waive any rights or privileges existing under" certain code sections, including section 726 of the Code of Civil Procedure. Although section 2953 was not in effect at the time of the transactions in question, it is entirely consistent with the right of a mortgagor or trustor to make a subsequent waiver, since by its terms it purports to apply only to a waiver agreement which is exacted in advance as a condition to the making or renewing of any loan secured by a mortgage or deed of trust.
 [3] The fact that a note is secured is an affirmative defense which must be pleaded. (Tucker v. Howe, 139 Cal.App. 161 [33 P.2d 1055]; Crescent Lumber Co. v. Larson, 166 Cal. 168 [135 P. 502]; Hibernia S. & L. Soc. v. Thornton, 117 Cal. 481 [49 P. 573].) Even if the defendant sets up the defense that the note was secured, the trial court has jurisdiction to determine that fact (Kempton v. Appellate Department of Superior Court, 3 Cal.App.2d 374 [39 P.2d 846]) and the plaintiff may be able to show that he has a right to recover despite the fact that security was given. (Crescent Lumber Co. v. Larson, supra.) *268
 [4] It follows that section 726 of the Code of Civil Procedure is not necessarily a bar to an action on the note, and that its benefits may be waived by a failure to call the attention of the court to the true situation. [5] Since this is a default judgment, and the attention of the court was not directed to the fact of security, the judgment is not void and cannot be collaterally attacked. In addition, section 726 was enacted for the benefit of the primary debtor. Plaintiff is not the primary debtor, but in fact claims in opposition to him, and should not be permitted to make such an attack.
 [6] Defendant urges that plaintiff was not entitled to a judgment subjecting the land to the lien of plaintiff's bond, but the defendant has not appealed. It is well settled that on appeal errors affecting a party who does not appeal will not be reviewed, even though excepted to by him in the trial court and included in the bill of exceptions. (California Canning Peach Growers v. Williams, 11 Cal.2d 233, 238 [78 P.2d 1161]; Denman v. Smith, 14 Cal.2d 752, 755 [97 P.2d 451]; Ray v. Parker, 15 Cal.2d 275, 282 [101 P.2d 665].)
 We conclude, therefore, that plaintiff cannot attack the title defendant acquired at the execution sale, as the judgment on which it was based was not void, and that defendant cannot complain of the provisions of the judgment giving plaintiff a lien on the property because he took no appeal.
 [7] This is an action in equity and the decision carries out the principles of equity by giving justice to both parties. Defendant, by suing on the note instead of foreclosing, chose to disregard the security given and to rely on the title secured on the execution sale. Defendant thus made an election of remedies (Ould v. Stoddard, 54 Cal. 613; Campan v. Molle, 124 Cal. 415 [57 P. 208]), and cannot now pursue the concurrent remedies of foreclosure by action or by trustee's sale. [8] Having failed to try to cut off the rights of intervening creditors by foreclosing his deed of trust, defendant cannot claim a greater title than his judgment debtor had at the time of the judgment and execution sale, and since the property was then subject to the lien of plaintiff's street improvement bond, the judgment herein properly quieted title in defendant subject to that lien.
 The judgment is affirmed.
 Shenk, J., Curtis, J., Edmonds, J., Carter, J., Traynor, J., and Schauer, J., concurred.
