Adding additional fields to Confirmation area revisited

My question wasn't answered well that I asked yesterday so I am going to give more detail in hopes of an answer. The reference to post https://premium.wpmudev.org/forums/topic/appointments-layout-design#post-298968 is often used I have found. A lot of people have questions about adding to the confirmation area. I have used the code from this post but I still need clarification when using it for a field rather than a checkbox. The issue I am having is not the adding of the field but rather the getting the submitted answer to show up on my admin side. The problem is the following code

$add = 'var app_newsletter=0;$("#appointments_newsletter").change(function(){if ($("#appointments_newsletter").is(":checked")){app_newsletter=1;}else{app_newsletter=0;}});';
$script = str_replace( '"post_confirmation",', '"post_confirmation", app_newsletter:app_newsletter,', $script );

. This code is specifically for a checkbox. While researching the submit for a field I cannot seem to find the correct code to replace this for submission.

If you could help me with this one line I would really appreciate it.