Maytag Dishwasher cycling.

My Maytag Quiet Series 300 dishwasher is going crazy. One time you start it and it works fine and the next time it doesn’t. I feel like it has something to do with the door. When I start it it will fill up and then run for 3 seconds and then idle for 8 seconds. It never turns off, all the lights stay lit, it did this for an hour and never did anything else. I’ll then hit cancel and drain it. I will re-start in a few hours or the next day and sometime it will do this again and sometimes it will work.
Any ideas??? :confused: