the same issue for me as well, the value is not getting update
Apparently “document.getElementById('textBox1').value “ return nothing.
from my own experience, this is way more easy to retrieve a element with a class name using jquery, like that :
var resultVal = “some text”;
$('.MyClass').text(resultVal);
or if it’s an input (textbox) :
var resultVal = “some text”;
$('.MyClass input').val(resultVal);
Sometimes also the javascript snippet is loaded before the element, and therefore does not found your element ( if it’s happening you can try to move your javascript snippet or add a set time out function).