
215 Cal.App.3d 353 (1989)
263 Cal. Rptr. 592
FRANK ANNINO & SONS CONSTRUCTION, INC., Plaintiff and Appellant,
v.
McARTHUR RESTAURANTS, INC., et al., Defendants; ALAIN F. DUPUIS, Movant and Respondent; KENDALL K. WATSON, Objector and Appellant.
Docket No. B035360.
Court of Appeals of California, Second District, Division Seven.
November 7, 1989.
*354 COUNSEL
Tamila C. Jensen and Bernard Grossman for Plaintiff and Appellant and for Objector and Appellant.
Maguire, Toghia & Orbach, David M. Orbach and Pamela A. Davis for Movant and Respondent.
OPINION
JOHNSON, J.
Plaintiff Frank Annino & Sons Construction, Inc., and its former attorney, Kendall K. Watson (appellants), appeal from an order *355 awarding sanctions under Code of Civil Procedure section 128.5[1] to Alain F. Dupuis, a former defendant in the action. We affirm.

ISSUES
The issues on appeal are: (1) Did the trial court have jurisdiction to entertain a motion for sanctions on behalf of a person whom plaintiff had previously dismissed as a party defendant?
(2) If the trial court had jurisdiction did it, nevertheless, abuse its discretion in awarding sanctions against plaintiff or its attorney for naming Dupuis as a defendant without a factual basis for doing so or for failing to dismiss Dupuis when they first knew or should have known there was no factual basis for naming him as a defendant?
(3) Should sanctions be imposed against appellants for pursuing a frivolous appeal?

FACTS AND PROCEEDINGS BELOW
The underlying action arose out of an alleged breach of contract by the corporate defendants in failing to give Annino Construction the first right of refusal on construction of new restaurants for defendants. Mr. Dupuis, president of one of the corporate defendants, was named as an individual defendant in plaintiff's first amended complaint filed in June 1987. The complaint sought damages in excess of $25 million against Mr. Dupuis personally.
The basis for Mr. Dupuis's individual liability was alleged as follows: "Plaintiff alleges based on information and belief that at all times mentioned herein there existed a unity of interest and ownership between defendants SEAFOOD BROILER, INC., and ALAIN F. DUPUIS, so that any individual and separateness between defendants SEAFOOD BROILER, INC. and DUPUIS have ceased, and defendant corporation is the alter ego of defendant DUPUIS in that said corporate defendant business was carried on as an individual proprietorship without proper corporate structure or procedure. Defendant DUPUIS incorporated and conceived said corporation as a device to avoid individual liability and for the purpose of substituting a corporation in the place of defendant's individual proprietorship."
After Mr. Dupuis's demurrer to the complaint was overruled, his attorney wrote to plaintiff's attorney, Watson, in December 1987, demanding *356 Mr. Dupuis be dismissed from the action on the ground he had never been a stockholder of any of the defendant corporations and held no ownership interest in them. The letter went on to state if plaintiff did not voluntarily dismiss Mr. Dupuis by the end of 1987, Mr. Dupuis would file a motion for summary judgment.
At no time prior to Mr. Dupuis's motion for summary judgment did counsel for Mr. Dupuis supply any evidence to plaintiff backing up his claim there was no basis for plaintiff's alter ego contention. He did, however, propound interrogatories to plaintiff asking what facts plaintiff relied on to support its alter ego allegations. Plaintiff responded it relied on "the facts, terms and conditions of the written agreement" and that Mr. Dupuis "personally sabotaged and advised [plaintiff] that according to his interpretation the written agreements were not binding." At no time did plaintiff conduct any discovery on the alter ego issue.
In February 1988, Mr. Dupuis filed a motion for summary judgment on the issue of his personal liability. His accompanying declaration stated he was not an incorporator of the corporate defendants and had never been a shareholder. Plaintiff did not dispute any of the facts contained in Mr. Dupuis's declaration. On the contrary, between the filing of the motion and the date set for hearing plaintiff's counsel acknowledged to Mr. Dupuis's counsel, orally and in writing, the motion was "well taken" and "we have concluded that Mr. Dupuis was improperly joined as a party ... and we will so stipulate."
The day before Mr. Dupuis's motion for summary judgment was set for hearing, plaintiff dismissed Mr. Dupuis from the action without prejudice and filed an opposition to the motion for summary judgment on the sole ground the court lacked jurisdiction to hear the motion for summary judgment because Mr. Dupuis was no longer a party to the action. The trial court continued the matter for further briefing on the jurisdictional question.
Subsequent to his involuntary dismissal from the action, Mr. Dupuis filed a motion for sanctions against plaintiff under section 128.5. The grounds for the motion were that plaintiff's and plaintiff's attorney's actions and tactics in prosecuting the action against Mr. Dupuis were in bad faith, frivolous and intended solely to cause delay. Plaintiff filed opposition to the sanctions motion arguing, as it had on the summary judgment motion, the court lacked jurisdiction because Mr. Dupuis was no longer a party. Plaintiff also argued it and its attorney had not acted in bad faith and, even if they had, the amount of sanctions sought was excessive.
*357 The motion for summary judgment and sanctions was consolidated for hearing. The trial court ordered the summary judgment motion off calendar for lack of jurisdiction. The trial court found it had jurisdiction over the sanctions motion and awarded sanctions against plaintiff and its attorney, Watson, jointly and severally, in the sum of $6,807.50. Plaintiff and Watson appeal the sanction order.

DISCUSSION

I. THE COURT HAD JURISDICTION OVER DUPUIS'S SANCTION MOTION EVEN THOUGH PLAINTIFF HAD DISMISSED DUPUIS AS A PARTY.
(1) Appellants argue that after the clerk entered the involuntary dismissal of Dupuis as a defendant he was no longer a party to the action and could not file a motion for sanctions.[2] Section 128.5, subdivision (c), provides, "Expenses pursuant to this section shall not be imposed except on notice contained in a party's moving or responding papers; ..." (Italics added.) Appellants cite cases holding once a person has been dismissed from an action he is no longer a party and the court lacks jurisdiction to conduct any further proceedings as to him. (Lori Ltd. v. Wolfe (1948) 85 Cal. App.2d 54, 61 [192 P.2d 112]; and see 6 Witkin, Cal. Procedure (3d ed. 1985) at p. 329.) Undoubtedly, this is the general rule. However, courts have carved out a number of exceptions to this rule in order to give meaning and effect to a former party's statutory rights. Even after a party is dismissed from the action he may still have collateral statutory rights which the court must determine and enforce. These include the right to statutory costs and attorneys fees and the right to notice and hearing on a motion to set aside the dismissal. (Rosen v. Robert P. Warmington Co. (1988) 201 Cal. App.3d 939, 943 [247 Cal. Rptr. 635]; McDonald v. Severy (1936) 6 Cal.2d 629, 631 [59 P.2d 98]; Spinks v. Superior Court (1915) 26 Cal. App. 793, 795 [148 P. 798].)
The rationale for retaining jurisdiction in Spinks is particularly appropriate to the case before us. In Spinks, the plaintiff filed several complaints and Spinks filed verified answers. On the day before the trial was to begin, plaintiff filed a voluntary dismissal of the action. Spinks filed a memorandum of costs and the trial court granted him a judgment for the amount *358 claimed. In the course of attempting to collect his judgment, Spinks obtained a court order for inspection of plaintiff's books and records. When plaintiff refused to comply with that order Spinks sought a contempt citation. The trial court refused to hold a contempt hearing on the ground the judgment was void because there was no jurisdiction to enter a judgment after the action had been voluntarily dismissed by plaintiff. The Court of Appeal disagreed and ordered the trial court to proceed with the contempt hearing. The court acknowledged the voluntary dismissal ended the suit, however, "it cannot be contemplated that the legislature, having provided authority and means for the securing of costs to litigants, intended to leave a defendant remediless against a plaintiff who chose to bring an action and put a defendant to great costs in preparing to meet the same and then dismiss the suit." (26 Cal. App. at p. 795.)
The sanctions statute serves much the same purpose as awarding costs to the defendant in Spinks: to discourage parties and their attorneys from engaging in bad faith tactics and to compensate a party victimized by such tactics. (§ 128.5, subd. (a).) If one party engages in bad faith tactics against another party, there is no basis in logic or public policy to deny the victim the remedy of sanctions simply because, through the bad actor's own doing, the victim is no longer a party.
This point is illustrated by Mungo v. UTA French Airlines (1985) 166 Cal. App.3d 327 [212 Cal. Rptr. 369] in which the court, without addressing the jurisdictional issue, upheld an award of sanctions to defendants on their motion filed after they were involuntarily dismissed by plaintiffs. In Mungo, plaintiff's counsel had a year and a-half notice of the date set for trial. At the mandatory settlement conference, six days before the trial date, he declared he was ready for trial on the date scheduled. In reliance on that representation, counsel for defendant spent over $12,000 on trial preparation bringing in witnesses from around the world. Then, on the day of trial, plaintiffs' counsel requested a continuance on the ground their key witness was in Tahiti and could not be reached. The continuance was denied. Plaintiffs then dismissed the action against defendants. Defendants moved for, and were awarded, sanctions. (Id. at pp. 332-333.)
Allowing a person no longer a party to obtain sanctions for the bad faith tactics he suffered while he was a party is clearly consistent with the purposes of section 128.5.[3] This is especially so where, as here, the person is no *359 longer a party because he was involuntarily dismissed from the action by the party who engaged in the bad faith tactics. Adopting appellants' position would render section 128.5 virtually useless as a weapon against actions or tactics that are totally without merit or undertaken for the sole purpose of harassment. A party or an attorney could act in the most egregious bad faith, engage in the most outrageous conduct, and do so with impunity. They could avoid sanctions by simply dismissing the action without prejudice. Under appellants' theory the injured person could not move for sanctions because he would no longer be a party. The trial court could not award sanctions on its own motion because sanctions can only be awarded to a party. (§ 128.5, subds. (a), (c).) Such a result is untenable given the obvious purpose of the sanction statute. It also violates any reasonable sense of justice and fair play. (See Spinks v. Superior Court, supra, 26 Cal. App. at p. 796.)

II. THE TRIAL COURT DID NOT ABUSE ITS DISCRETION IN AWARDING SANCTIONS AGAINST PLAINTIFF AND ITS ATTORNEY.
(2) An award of sanctions is proper when an action instituted by a party is "totally and completely without merit...." (§ 128.5, subd. (b)(2); Finnie v. Town of Tiburon (1988) 199 Cal. App.3d 1, 12 [244 Cal. Rptr. 581]; Winick Corp. v. County Sanitation Dist. No. 2 (1986) 185 Cal. App.3d 1170, 1177 [230 Cal. Rptr. 289].) An action is totally and completely without merit when it is brought despite knowledge "of the facts and law that clearly indicate the [defendant] has no liability" (Winick Corp., supra, 185 Cal. App.3d at p. 1180) or in the face of a "complete lack of evidence to substantiate [plaintiff's] charges...." (Finnie, supra, 199 Cal. App.3d at p. 14.)
It is clear from the plaintiff's answers to interrogatories and the declaration of its president, Dominick Annino, plaintiffs never had any evidence to support its claims against Mr. Dupuis before naming him as a defendant. Nor did plaintiff ever attempt to discover any evidence which might support those claims. (Winick Corp., supra, 185 Cal. App.3d at p. 1180.) Under these facts, compensation for the costs of defending against plaintiff's frivolous action was not an abuse of discretion. (Cf. Winick Corp., supra, at p. 1181.)

III. RESPONDENT IS NOT ENTITLED TO SANCTIONS ON APPEAL.
Contrary to Mr. Dupuis's contention, this is not a frivolous appeal. The question whether the trial court had jurisdiction to award sanctions to Mr. Dupuis after he had been dismissed as a party to the action was one of first impression "to be weighed with brows-a-wrinkle." (Llewellyn, The Bramble *360 Bush (1930) at p. 46.) Our disagreement with appellants' position on the issue does not mean their effort to convince us otherwise was frivolous.

DISPOSITION
The order awarding sanctions is affirmed. Respondent is awarded his costs on appeal.
Lillie, P.J., and Woods (Fred), J., concurred.
NOTES
[1]  Unless otherwise indicated, all subsequent references are to the Code of Civil Procedure.
[2]  Section 581, subdivision (c) provides: "A plaintiff may dismiss his or her complaint, or any cause of action asserted in it, in its entirety, or as to any defendant or defendants, with or without prejudice prior to the actual commencement of trial."

Section 581d provides: "A written dismissal of an action shall be entered in the clerk's register and is effective for all purposes when so entered."
[3]  The case before us is distinguishable in this respect from Rabbit v. Vincente (1987) 195 Cal. App.3d 170, 174 [240 Cal. Rptr. 524]. Rabbit held the court lacked jurisdiction to award sanctions under section 128.5 to a person who had been dismissed from the action when the bad faith tactics occurred after her dismissal and related to her role as a witness, not a party.
