jQuery Form Not Submitting

Continuing my theme of posting about minor issues that waste far too much development time, I bring you the perils of Adblock plugins.

I love Adblock Plus. I use it all the time and even use it to block Facebook from following me around the internet.

The problem arises when you forget it's there and it's blocking something you actually want.

For example, I was setting up several forms today using the jQuery Form plugin by Mike Alsup. I've done this a million times before so it's pretty much plug in some code from another site, modify a couple field names and it's done. Easy.

Well 3 of the 4 forms were working great as expected, but the 4th would not submit through javascript for some reason. WHY?!?! WHAT'S DIFFERENT ABOUT THIS PAGE?

Turns out, the name of the page was "advertise.php". Adblock Plus, as I'm sure all the other similar plugins do as well, blocks anything with a name that sounds like it could be an ad.  Although it doesn't appear to block it if it's the main requested file in the address bar.

I would usually respect a user's desire to easily block ads, but this particular page was not an advertisement.  It was a form for potential advertisers to submit their details so they could place their own ads.

So, the plugin was blocking the AJAX request to advertise.php and nothing was happening on submit.  Disabling Adblock fixes it, but I still have to think about the users out there who may have it enabled and can't submit the form. I solved this by sending the post to a separate processor file that did not include the word "advertise".

I need to go check the mirror now to see if I have a massive bald patch on the back of my head.

Post a comment

(optional, will not be displayed)
If you can see this field, please leave it blank, or your comment will not be submitted

Photo of Carl

About Carl

Web Programmer. Shutterbug. New Father. Enjoying life in New Zealand.

Read more

Facebook  LinkedIn  Twitter

Recent Activity


Photo Tags