JavaScript RS Form Submission Text

We have a form on our website, that allows the user to book data and time for our event.

When the user has submitted the form, an email goes to the user containing the details.

This is the JavaScript we use for the date and time:

<script type="text/javascript">
 
function popCampus(){

      var parent_array = new Array();
 
      parent_array[''] = [''];

/* Copy the array details between here */

parent_array['3']=['','1|St Helens Town Centre Campus','2|Knowsley Main Campus (Stockbridge)'];
parent_array['18']=['','1|St Helens Town Centre Campus','2|Knowsley Main Campus (Stockbridge)'];
parent_array['27']=['','1|St Helens Town Centre Campus','2|Knowsley Main Campus (Stockbridge)'];
parent_array['33']=['','1|St Helens Town Centre Campus'];
parent_array['39']=['','2|Knowsley Main Campus (Stockbridge)'];
parent_array['40']=['','1|St Helens Town Centre Campus'];
parent_array['41']=['','1|St Helens Town Centre Campus'];
parent_array['42']=['','1|St Helens Town Centre Campus'];
parent_array['43']=['','1|St Helens Town Centre Campus'];
parent_array['44']=['','1|St Helens Town Centre Campus'];
parent_array['45']=['','1|St Helens Town Centre Campus','2|Knowsley Main Campus (Stockbridge)'];
parent_array['46']=['','1|St Helens Town Centre Campus'];
parent_array['47']=['','1|St Helens Town Centre Campus'];
parent_array['48']=['','1|St Helens Town Centre Campus'];

/* And Here*/

      var thechild = document.getElementById('CampusID');
 
      thechild.options.length = 0;
 
      var cid = document.getElementById('CourseAreaID');

      var parent_value = cid.options[cid.selectedIndex].value;
 
      if (!parent_array[parent_value]) parent_value = '';
 
      thechild.options.length = parent_array[parent_value].length;
      
      for(var i=0;i<parent_array[parent_value].length;i++) {

              thechild.options[i].text = parent_array[parent_value][i].substring(2, 100);
                  
             thechild.options[i].value =  parent_array[parent_value][i].substring(0, 1);
         
      } 

      var datesc = document.getElementById('EventDateID');
 
      datesc.options.length = 0;

     datesc.options.length = 2;

    if (cid.options[cid.selectedIndex].value == "40"  
            || cid.options[cid.selectedIndex].value == "41"  
            || cid.options[cid.selectedIndex].value == "42" 
            || cid.options[cid.selectedIndex].value == "43" 
            || cid.options[cid.selectedIndex].value == "44"  ) {
             datesc.options[1].text = "Wednesday 5th July 2023, 4pm - 7pm";
             datesc.options[1].value =  26;
          }  
    else {
        datesc.options[1].text = "Wednesday 5th July 2023, 2pm - 7pm";
        datesc.options[1].value =  27;
   }


}
 
</script>

The email successfully shows the campus location, but for the date and time it is showing the value and not the text. This is the code for the email to the user:

<h3 style="color: #0f5f72;">Booking Details</h3>
<p><strong>Course Area:</strong> {CourseAreaID:text}<br> <strong>Campus:</strong> {if {CampusID:text}=1} St Helens Town Centre Campus{/if} {if {CampusID:text}=2} Knowsley Main Campus (Stockbridge){/if}<br> <strong>Date and Time:</strong> {EventDateID:text}</p>

This is what is being displayed in the email:

enter image description here

Does anyone know how we can get it to display the text and not the value.

Any help will be much appreciated.

Thanks
Sam