Hi Susan, the "is it legal" aspect of your question really would need the opinion of an attorney, but you've gotten great responses on what is customary. It would seem highly unusual for the status to be changed to "S"old, prior to the closing date. While the seller cannot accept another offer once the property is under contract, back up offers can certainly be accepted. Also, if here is a home sale contingency on the contract it could leave the door open, or if the buyer is not meeting his/her obligations.
If you are in a situation where you feel that you should have an opportunity and you are being stone-walled, then have your agent (I hope you are working with one, no reason not to...) contact the listing broker for clarification. If you can't get your offer through to the seller via the agent, you can also have your agent submit it directly to the seller's attorney.
Fact is, in NJ, we as agents are really obligated to present any and all offers we receive to the seller.
"Unwavering Commitment to Service"
Find success at www.feenick.com