title: show input value of html form in another field
body: <p>I have a html form with fields that are filled in by the user. I also have radio buttons that when clicked show a specific piece of text in a textarea. What I want to do is to take the given name value filled in by the user and display that value within the text that is triggered by the radio button. I've added the code I have so far. </p>
  
  <p>Code that takes personal information like first and last names. </p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt; 
  
  &lt;form class="form-inline" action="/action_page.php"&gt;
    &lt;label for="Gender"&gt;Gender:&lt;/label&gt;
    &lt;option="text" id="cName" placeholder="Gender" name="cName" size="40"&gt;
    &lt;Select name="nom" size="1"
    &lt;option&gt;Mr
    &lt;option&gt;Mr
    &lt;option&gt;Ms
    &lt;/select&gt;
    &lt;/form&gt;
  
  &lt;label for="fName"&gt;Family Name:&lt;/label&gt;
    &lt;input type="text" id="fName" placeholder="Family Name" name="fName"&gt; 
    &lt;label for="gName"&gt;Given Name:&lt;/label&gt;
    &lt;input type="text" id="gName" placeholder="Given Name" name="gName" 
    &lt;label for="dob"&gt;DOB:&lt;/label&gt;
    &lt;input type="date" id="dob" placeholder="DOB" name="dob"&gt;
  
    &lt;p id="dob"&gt;&lt;/p&gt; 
  
  &lt;/head&gt;
  &lt;/form&gt; 
  
  </code></pre>
  
  <p>Code that uses radio buttons to show a specific piece of text. </p>
  
  <pre><code>
  &lt;label for="introduction"&gt;Introduction:&lt;/label&gt;
         &lt;FORM NAME="myForm" ACTION="" METHOD="POST"&gt; 
          &lt;INPUT TYPE="radio" NAME="input" VALUE="green" onchange="testResults(this.form)"&gt;gold
          &lt;INPUT TYPE="radio" NAME="input" VALUE="blue" onchange="testResults(this.form)"&gt;grey
          &lt;INPUT TYPE="radio" NAME="input" VALUE="green" onchange="testResults(this.form)"&gt;violet
          &lt;INPUT TYPE="radio" NAME="input" VALUE="orange" onchange="testResults(this.form)"&gt;black&lt;p&gt;
  
          &lt;textarea ID="textbox"  rows="10" cols="50" VALUE=""&gt;&lt;/textarea&gt;
  
           &lt;/FORM&gt;    
  
  </code></pre>
  
  <p>And my javascript code for the text that is displayed when clicking on a radio button. </p>
  
  <pre><code>&lt;SCRIPT LANGUAGE="JavaScript"&gt;
      function testResults (form) {
      var TestVar1 = form.input[0].checked;
      var TestVar2 = form.input[1].checked;
       var TestVar3 = form.input[2].checked; 
      var TestVar4 = form.input[3].checked;
        if (TestVar1 == true) {
          form.textbox.value = "We hereby certify that NAME1, born on MONTH, DAY, YEAR, was employed by LEGAL ENTITY, from MONTH DAY, YEAR to Month DAY, YEAR and held the position of ROLE, reporting to the DEPARTMENT.";
        } else if (TestVar2 == true){
          form.textbox.value = "We hereby certify that NAME2, born on MONTH, DAY, YEAR, was employed by LEGAL ENTITY, from MONTH DAY, YEAR to Month DAY, YEAR and held the position of ROLE, reporting to the DEPARTMENT.";
        } else if (TestVar3 == true) {
            form.textbox.value = "We hereby certify that NAME3, born on MONTH, DAY, YEAR, was employed by LEGAL ENTITY, from MONTH DAY, YEAR to Month DAY, YEAR and held the position of ROLE, reporting to the DEPARTMENT.";   
        } else if (TestVar4 == true) {
            form.textbox.value = "We hereby certify that NAME4, born on MONTH, DAY, YEAR, was employed by LEGAL ENTITY, from MONTH DAY, YEAR to Month DAY, YEAR and held the position of ROLE, reporting to the DEPARTMENT."; 
        }else if (TestVar1 == false &amp;&amp; TestVar2 == false &amp;&amp; TestVar3 == false &amp;&amp; TestVar4 == false) {
          form.textbox.value = "";
        }
      }
  
  &lt;/script&gt; 
  
  </code></pre>
  
  <p>I've tried to find a way to show the given name in place of "NAME1" in the piece of text but I can't. Any help would be appreciated. </p>
  
  <p>Thank you in advance for your help and may you all stay safe during these times. </p>