There are several suggested substitutes for commercial dishwasher detergent that use household products you probably have on hand. A combination of equal parts baking soda with liquid dish soap, borax or laundry detergent should give satisfactory results in a pinch.
Baking soda is a common ingredient in many homemade dishwasher detergent recipes because it helps clean dishes while exerting an anti-foaming action. In contrast, using laundry detergent or liquid dish soap alone is likely to leave you with a dishwasher full of suds. Of course, it is important to exercise care so you don't harm your appliance or void the manufacturer's warranty.