Answer the question
In order to leave comments, you need to log in
How to send div content from form to mail?
I'm trying to send the contents of the div and the data entered into the form to the mail, I send it via ajax without reloading, I collect data from the form using data: $form.serialize(), where $form is a variable for my form.
The question is, what should I replace this data: $form.serialize() with, so that not only the inputs and other form elements collected by this serialize are sent, but also the block with its contents?
Answer the question
In order to leave comments, you need to log in
well, get the contents of the block and add it to the sent data.
the question is what?
You get a query string, if you just need to work with data from the form, then it is better to use serializeArray() As a result, you will get an array with data
[
{
name: "a",
value: "1"
},
{
name: "b",
value: "2"
}
]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question