Skip to content
Advertisement

Contact Form Stuck in Validation

I am trying to get a contact form up and running for a portfolio website. I understand design, but have a very limited understanding of development/server side issues.

The form functions as expected, BUT when submitted the form returns “..sending” and things stop there. I do not receive an email, and the status does not progress.

My site is hosted on Hostinger, who does not utilize Apache (of which I have no understanding). However, from what I have read, I do need some type of php server like apache to make this form function. The host says that they do support Ajax and that the emails are not being blocked.

I am trying to use Ajax, with validate script, and php to allow form submission without leaving the current page as follows: (this is a MDB form). This is a link to the hosted site for reference: https://intakt-design.com

I am receiving this error in dev tools: Uncaught reference error: sendMessage() is not defined at validate form

I feel like this is the problem, but I don’t know what goes here, and google is leading me in circles…

code snippet link: https://mdbootstrap.com/snippets/jquery/marcin-luczak/2705367

Please excuse my ignorance, I’m new to web design (graphic design student), in general, and backend development is way over my head.

PHP:

JavaScript

HTML:

JavaScript

JS:

JavaScript

Advertisement

Answer

I don’t know why, but for some unusual reasons the sendMessage is not working. Try to rename the function. messageSending() in your js file and call it in your validateForm() function.

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement