title: How to submit selected responses along with the form?
body: <p>I have a questionnaire that the user goes through step by step and finally submits the form. I want the form where the user submits their name and phone number to be sent along with the selected responses. How can I add the user's selected responses to the form and submit them?</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//An example of a question where the user selects a gender
  function appGender() {
    scrollDown();
    $(".chat-content-list").append(
      '&lt;div&gt;&lt;span class="chooseGenderM"&gt;Male&lt;/span&gt;&lt;/div&gt;&lt;div class="chat-content-buttons-gender-block"&gt;&lt;span class="chooseGenderW"&gt;Woman&lt;/span&gt;&lt;/div&gt;'
    );
  }
  
  function genderNext() {
    $(".chooseGenderM").click(() =&gt; {
      document.querySelector(".chat-content-buttons-gender").style.display =
        "none";
      myMassange("Male");
    });
    $(".chooseGenderW").click(() =&gt; {
      document.querySelector(".chat-content-buttons-gender").style.display =
        "none";
      myMassange("Woman");
    });
  }</code></pre>
  </div>
  </div>
  </p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//submit form
  const form = document.getElementById("order_form");
  form.addEventListener("submit", formSend);
  
  async function formSend(e) {
    e.preventDefault();
  
    let error = formValidate(form);
    let formData = new FormData(form);
  
    if (error === 0) {
      let response = await fetch("sendmail.php", {
        method: "POST",
        body: formData,
      });
      if (response.ok) {
        let result = await response.json();
        alert(result.message);
        formPreview.innerHTML = "";
        form.reset();
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>//sendmail.php
  
  //Body
  if (trim(!empty($_POST['name']))) {
      $body .= '&lt;p&gt;&lt;strong&gt;Name:&lt;/strong&gt;' . $_POST['name'] . '&lt;/p&gt;';
  }
  if (trim(!empty($_POST['phone']))) {
      $body .= '&lt;p&gt;&lt;strong&gt;Phone:&lt;/strong&gt;' . $_POST['phone'] . '&lt;/p&gt;';
  }</code></pre>
  </div>
  </div>
  </p>