I know a lot (if not most) of you guys can relate to this, so I'm sharing my story in the hopes of making you guys feel better... or at least laugh at my pain.
So I've been working on a PHP that opens via Ajax, and then there's a form. When the user submits the form it processes the same PHP script, and then shows the results in the same Ajax DIV element. It's a little complicated since it's hard to debug a script that's opened in Ajax, but not too bad.
At around 10pm last night, I thought it was finished. I filled out the form, clicked Submit, and... the entire page reloads! Worse, it didn't run the processing function and didn't show the results of the form.
So I worked on this thing until FIVE AM! I went over it with a fine-toothed comb, changing every Javascript method I could think of... I think I developed 6 different ways to process the same thing. But none of them worked at all!
I even gave up at one point and just rebuilt the whole thing from scratch, thinking there had to be a typo somewhere that I was overlooking. But nope, it still didn't work.
I was mad, and frustrated, my hair was sticking straight up from my constant running my hand through my hair. Then, right before going to bed... I saw it.
The name of the script I had written was "example_whatever.php". But the link I had typed in the <form> statement? "example-whatever.php"
That was it. SEVEN hours of working on the same supposedly simple script, and the WHOLE TIME the problem was that I had failed to hit the Shift key, and used a - instead of an _.