jonmbake / bootstrap3-contact-form

Bootstrap 3 Contact Form with Captcha
MIT License
169 stars 84 forks source link

Error on submitting form #2

Closed macsupport closed 10 years ago

macsupport commented 10 years ago

When I click submit, I get the following error:

TypeError: 'undefined' is not an object (evaluating 'response.responseJSON.message')
jonmbake commented 10 years ago

Did you modify the code at all? Are you using the current version?

It looks like response.responseJSON is undefined. If you open Developer Tools and go to the network tab, what is the response from sendmail.php when you click submit?

macsupport commented 10 years ago

No changes in the code form my end and using the current version. Don't use IE so happy to pursue. Let me know what to use in Firebug to see php response.

jonmbake commented 10 years ago

@macsupport If you open up Firebug and go to the Net tab. When you click the Send Feedback button, you will see an entry to POST sendmail.php. If you expand the entry, it will show the Headers; can you confirm that there is a Content-Type application/json in the response header? Also, if you click on the Response tab, it should be valid JSON, something like {"message":"Invalid Security Code"}. Can you also confirm the response is JSON?

nickedw commented 10 years ago

Jon, I have the exact same issue. I get the content-Type application application/json Header and I see 11 requests in the Response tab. I am using your demo index.html form currently to take my own code out of the equation to get this working. I have also run a test.php script that sends mail OK from my host. I'm sure it's something stupid I'm doing but I just can't find it. Any ideas?

jonmbake commented 10 years ago

Hi Nick. Is the your contact form publicly available? I can take a quick look and try to debug. Feel free to send me an email: jonmbake@gmail.com. We'll get it figured it out.

nickedw commented 10 years ago

John,

            Thanks for such a prompt response:-

Here’s the link:-

Contact http://www.snapmedic.co.uk/contact.html

Thanks for your help,

Regards,

Nick

From: Jon Bake [mailto:notifications@github.com] Sent: 24 October 2014 02:08 To: jonmbake/bootstrap3-contact-form Cc: nickedw Subject: Re: [bootstrap3-contact-form] Error on submitting form (#2)

Hi Nick. Is the your contact form publicly available? I can take a quick look and try to debug. Feel free to send me an email: jonmbake@gmail.com mailto:jonmbake@gmail.com . We'll get it figured it out.

— Reply to this email directly or view it on GitHub https://github.com/jonmbake/bootstrap3-contact-form/issues/2#issuecomment-60332226 . https://github.com/notifications/beacon/AI76XqdkWiMVGxsJgyMUYDY3ORpl5SJfks5nGZ3wgaJpZM4B0q71.gif

gregoireborel commented 9 years ago

Hi guys, did you find any solutions? I have the same issue.

nickedw commented 9 years ago

Not really. I just replicated the directory structure in the example, and it worked so I was obviously missing a reference somewhere in the code originally. As I suspected, it was undoubtedly my own fault!

Nick