I
I
Ivan Nikiforov2021-06-10 08:08:43
JavaScript
Ivan Nikiforov, 2021-06-10 08:08:43

What is wrong here?

I'm probably blind and don't see the problem.

$(function() {
$("body").on("click", "#result", function() {
var q = $(#formDoor[]).val();
var p = $(#Door[]).val();

var n = "&formDoor[]=" + q + "&Door[]2=" + p;

$.ajax({
type: "POST",
url: "ajax/mail.php",
data: n,
success: function(t) {
alert('Mail Sent');
}
});
});
});


60c19e832aa06399554213.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rsa97, 2021-06-10
@defroing

#formDoor and #Door - what are these variables? If it is the id of the elements, then they must be in quotes.

D
Dmitry Kuznetsov, 2021-06-10
@dima9595

You are the problem! What's with the PHP tag?
Look into the variables q and p!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question