It *may* be valid: the issue is whether, on the circumstances of the case, either of the following would be found to exist:1) That it's enough for either spouse to sign, so it doesn't really matter if A signed as B or vice versa--it's a contract affecting both, and one clearly signed.2) There is evidence that the non-signing spouse had asked/instructed/authorized the other spouse to sign his/her name for him/her (and therefore that the non-signing spouse had agreed to the terms).Examples: Spouses are having home renovations done to their marital home; from the facts and context, it's clear that the spouses agree to the work; for some reason, spouse A signs spouse B's name (maybe they're very traditional, and the wife, A, thought it more appropriate for the husband, B, to sign a contractor agreement, but he wasn't around).Similar to the above, but spouse A signs both names.In either case above, a court would most likely  find the contract enforceable.On the other hand, say that spouse A has money pre-dating the marriage, which is not joint marital property. Without A's awareness and/or consent, spouse B signs a contract for A to purchase, using that money, an expensive car B wanted or to rent an apartment in NYC which B can use for extramarital affairs. In that case, since there is good reason to believe that A did not consent and it's not for the benefit of A, a court would very likely find the contract not enforceable.