Aug
2

Ajax Contact Form

I was working on incorporating Jamie Talbot’s ajax form onto my contact page last night. It was a super-easy install, but there were a couple dumb things that tripped me up for a while. Here they are in case you’re having the same problems:

Problem 1: Nothing happens when you click on the submit button – Everything worked on my mac, but when I went to test on the pc nothing happened. I got this message in my javascript console:
Error: uncaught exception: Permission denied to call method XMLHttpRequest.open

Solution: The fact that it was working on one platform and not the other threw me for a loop, but I eventually realized that when I typed in the url on my pc I didn’t include the www. Sure enough, if I hit the page as http://www.rettmartin.com/contact-rett then it worked, and if I hit it as http://rettmartin.com/contact-rett it didn’t work. The error means that you’re trying to transfer data to/from a remote domain, which I guess kind of makes sense, although it should still be the same domain, right? Anyway, to solve this, I just went into my domain host admin panel and changed it so that if someone types rettmartin.com it adds the www.

Problem 2: You’re changing the php code for the plugin either through the editor or via ftp, but the rendered html is not reflecting the changes – I struggled with this for a good 20-30 minutes and the weird thing is that if I changed something like the label text it would get updated, but if I took out a paragraph tag it would still be there.

Solution: There might be a better way, but I found out that if I call the contact form in the page template like this < ?php holler() ?> then any changes I make to the php file are instantly reflected. Whereas if I use this code < --holler--> (with an ! right after the first carrot) in the copy of the page then I have issues.

Problem 3: Removing the break tag from between the label and the input fields causes all sorts of display issues in IE on the pc.

Solution: I have no clue, anyone? In the mean time I’ve left the breaks in and just told everyone except IE to not display them.

On a side note, I saw one of the most disgusting things this morning on the bus. It was not even 8:00 am and some guy was drinking pickle juice from a plastic pouch. I mean he was sipping on it like it was hi-c, except without the straw. Pretty sick.

Leave a Comment