My name is Peter. I am a retired field service refrigeration, appliance technician.
I think you have put your question in the wrong section this section is fro freezers. Freezers do not have a float switch.
So, lets assume you have a dishwasher. There are several reasons you keep filling with water:
1.) You may have a float that is restricted with soap film. This is a white bulb on the bottom of your unit. Remove the top and clean.
2.) At the top of your float is a contact switch. This switch activates you water discharge pump. This component is about $12.00 USD.
You can check this with a Ohm meter set to the lowest Ohms. Hold the switch button in and you should get a reading of '0' Ohms.
The above is just for your information. It is not your problem.
1.) Bad Water Supply Valve - Often the water supply valve becomes worn and blocked from age. When this happens you do not get the 65 PSI water pressure to close the water supply solenoid valve. Within your control system your float signals the valve to close. In your case it does not close.
Ok, lets check out your water supply shut off valve. With a bucket under the water supply valve, turn the valve off and disconnect the hose. If water comes out, then the supply vale is plugged and does not provide enough pressure to close the water supply solenoid valve on your unit. You have a bad water supply valve.
Ok, the water shuts off. Lets look at your unit water supply solenoid valve. The spool in the valve often becomes stuck with age.
With a hair drier gently warm the valve (NOT HOT) and gently tap the valve to try and loosen the spool.
This sometimes works. In the end you are going to have to replace the valve.
This is a pretty easy repair. The valve is about $35.00 USD. If I were to make a service call at your home, I would have to charge you $350.00 USD.
Send me your model number. It is located either on the face of your dish washer after you open the door or on top of the door.
Call me and I will walk you through this @ 443-306-1362.
I will be expecting a Christmas Card in return.
Glen Burnie, MD USA