Showing form input data in a different ID in same form

I have a form with input textboxes with IDs as follows:

#ApplicantFirstName
#ApplicantSurname
#ApplicantAddress
#ApplicantPostcode

Later in the form, there is a consent where I need to show the above details in a statement.

I have the consent as follows:

<p>I <span id="ApplicantFullName"></span> of <span id="ApplicantFullAddress"></span> hereby give my permission for the company to share personal information with other service providers</p>

The function is then triggered on a dropdown being clicked with onclick="updateConsent(); being added to the dropdown.

I have written the following but it’s not working:

<script type="text/javascript">
   function updateConsent(){
      document.querySelectorAll("#ApplicantFirstName, #ApplicantSurname").innerHTML = document.getElementById(ApplicantFullName).innerHTML ;
      document.querySelectorAll("#ApplicantAddress, #ApplicantPostcode").innerHTML = document.getElementById(ApplicantFullAddress).innerHTML ;
   }
</script>

Is that the correct script to use?

I’m not getting any errors, just doesn’t appear to be working

32 thoughts on “Showing form input data in a different ID in same form”

  1. 924170 848923Hi. Cool post. Theres an issue with your website in firefox, and you might want to check this The browser may be the market chief and a great section of men and women will pass over your fantastic writing because of this issue. 670869

    Reply
  2. 720811 637630Oh my goodness! a amazing post dude. Thank you Even so I will probably be experiencing issue with ur rss . Dont know why Can not subscribe to it. Will there be any person finding identical rss difficulty? Anybody who knows kindly respond. Thnkx 740057

    Reply