0

I want to retreive the html code of a form in order to send it on submit. For inputs and textarea, I can retreive the contents with:

$('input').attr('value', function() { return $(this).val();});

For select items , how I must process? thank you,

alia
  • 163
  • 3
  • 12
  • Does this answer your question? [jQuery: serialize() form and other parameters](https://stackoverflow.com/questions/10398783/jquery-serialize-form-and-other-parameters) – freedomn-m Oct 22 '20 at 16:34
  • You'll find it easier to just `.serialize()` the form, rather than worry about individual controls. Although it's not clear what you mean by *"retrieve the html code of a form"* so you may want something very different `$("form").html()` – freedomn-m Oct 22 '20 at 16:36
  • I want to get the code of the form in order to send it in an email, instead of printing the form – alia Oct 22 '20 at 16:40
  • I will see the .serialize() – alia Oct 22 '20 at 16:41

0 Answers0