When a dishwasher overflows, the float switch assembly is the most likely cause. The float itself may be sticking, or the electrical switch that turns the water on and off may be malfunctioning. Neither is difficult to fix.
Open the dishwasher door and locate the float switch. It should be a cylinder-shaped piece of plastic and may be set to one side along the front of the cabinet or near the sprayer head in the middle of the machine.
Check the float to make sure it moves freely up and down on its shaft. (You may have to unscrew and remove a protective cap to get to the float.) If the float sticks, you'll need to clean away any debris or mineral deposits that are causing it to jam.
Pull the float off the shaft, then clean the inside of the float with a bottle brush. Clean the shaft with a scrub brush.
Reinstall the float and check that it moves smoothly.
Set the dishwasher to fill, and check to see if it overflows. If it still malfunctions, you need to replace the float switch.
Turn off power to the dishwasher by unplugging it or turning off the circuit breaker.
Remove the service panel that runs along the bottom front edge of the dishwasher. If it is screwed to the dishwasher, remove the screws with a screwdriver. If the panel hangs on hooks, pull the panel out and swing it up to get it off the hooks.
Locate the float switch. Wrap each wire with masking tape and label each so you can reinstall them correctly on the new switch. Then remove the wires with needle-nose pliers.
Remove the old switch, using a screwdriver or a nut driver and socket to loosen the fasteners.
Take the switch to an appliance store and purchase an exact replacement.
Install the new switch and attach the wires.
Replace the service panel, turn on the power and test the machine.