I have written the following ajax call but only the q and email parameters are being sent, I've tried replacing message as I thought that it may be a key word but that still didn't work. I'm lost for ideas now.
$.ajax({
type: 'POST',
url: '/ajax/functions.php',
data: {
q: 'need_help',
email: $('input[name=email]').val(),
message: $('input[name=message]').val()
}
}).done(function(response) {
console.log(response);
});
Any help is much appreciated.
Form Code:
<div class='form-group col-sm-offset-3 col-sm-6'>
<input class='form-control' type='email' name='email' placeholder='Your email'>
</div>
<div class='form-group col-sm-offset-3 col-sm-6'>
<textarea class='form-control' name='message' placeholder='What is your problem?'></textarea>
</div>
<div class='form-group col-sm-offset-3 col-sm-6'>
<input id='button_submit' type='submit' class='btn btn-primary form-control' value='Send' name='need_help' data-loading-text='Sending...'>
</div>
Before you say it's not in a form the ajax call is sent out in an onClick on the submit button, also I only have a blank file for the ajax at the moment but I can see the error in the developer network tab.