title: When I add the name attribute, the form action no longer works
body: <p>I would like the form, in addition to sending leads to the network with general_api, to save the data on a sheet.
  Without writing sheet data, the wf_general_api form action works fine. If I add &quot;name =&quot; on the form, it saves the sheet data correctly but the wf_general_api file no longer works.</p>
  <pre><code>&lt;form method=&quot;post&quot; accept-charset=&quot;utf-8&quot; role=&quot;form&quot; name=&quot;gsheet&quot; action=&quot;general_api.php&quot;&gt;
  </code></pre>
  <p>This is general_api.php for send lead to the network:</p>
  <pre><code>&lt;?php
  
  function clean_phone_number($value){
    if(substr($value,0,4) == '0039')
        $value = substr($value,4);
  
    $value = preg_replace('~\D~', '', $value);
    $value = preg_replace('/\s+/', '', $value);
  
    if(strlen($value)&gt;10 &amp;&amp; substr($value, 0, 2) == '39' &amp;&amp; substr($value, 2, 1) == '3')
        $value = substr($value,2);
  
    return $value;
  }
  
  function clean_zipcode($value){
  
    $value = preg_replace('~\D~', '', $value);
    $value = preg_replace('/\s+/', '', $value);
  
    return $value;
  }
  
  $post_data = [
    'source_id' =&gt; SOURCE_ID,
    'aff_sub1' =&gt; '',
    'aff_sub2' =&gt; '',
    'name' =&gt; $_POST['name'],
    'phone' =&gt; clean_phone_number($_POST['phone']),
    'quantity' =&gt; $_POST['quantity'],
    'address' =&gt; $_POST['address'],
    'city' =&gt; $_POST['city'],
    'zipcode' =&gt; clean_zipcode($_POST['zipcode']),
    'notes' =&gt; $_POST['notes'],
    'doubleCheck' =&gt; 1
  ];
  
  $curl = curl_init();
  
  curl_setopt_array($curl, array(
    CURLOPT_URL =&gt; SEND_URL,
    CURLOPT_RETURNTRANSFER =&gt; true,
    CURLOPT_ENCODING =&gt; '',
    CURLOPT_MAXREDIRS =&gt; 10,
    CURLOPT_TIMEOUT =&gt; 0,
    CURLOPT_FOLLOWLOCATION =&gt; true,
    CURLOPT_HTTP_VERSION =&gt; CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST =&gt; 'POST',
    CURLOPT_POSTFIELDS =&gt; http_build_query($post_data),
    CURLOPT_HTTPHEADER =&gt; array(
      'Content-Type: application/x-www-form-urlencoded'
    )
  ));
  
  $response = curl_exec($curl);
  
  curl_close($curl);
  $json = json_decode($response,true);
  
  $status = $json['status'];
  
  if($status == 'double')
    $redirection_url = $json['check_url'];
  else
    $redirection_url = THANKYOU_URL;
  
  //header('Location: '.$redirection_url);
  echo &quot;&lt;script&gt;top.location.href='$redirection_url';&lt;/script&gt;&quot;;
  </code></pre>
  <p>And this is the gsheet for saving data:</p>
  <pre><code>const scriptURL = 'https://script.google.com/macros/s/xxxxx/exec'
  const form = document.forms['gsheet']
  
    form.addEventListener('submit', e =&gt; {
      e.preventDefault()
      fetch(scriptURL, { method: 'POST', body: new FormData(form)})
    })
  </code></pre>
  <p>If I add the name attribute, the form action no longer works. If I remove it, it resumes working but does not save the data on the sheet. How can I solve?</p>