Good Day,
I have the following JavaScript to allow a variable to show on a table header:
$(document).ready(function () {
$('.begindate input').change(function() {
$('#q15 .cf-section-header h1').text('Week 1 Beginning '+$('.begindate input').val());
$('#q40 .cf-section-header h1').text('Week 2 Beginning '+$('#q45 input').val());
if ($('[name=IsLocked]').val() == 'True')
{
$('#q15 .cf-section-header h1').text('Week 1 Beginning '+$('.begindate.ro').text());
$('#q40 .cf-section-header h1').text('Week 2 Beginning '+$('#q45.ro').text());
}
});
});
The calculated dates show on the subsequent approval forms when the JavaScript is adjusted to:
$(document).ready(function () {
$('#q15 .cf-section-header h1').text('Week 1 Beginning '+$('.begindate input').val());
$('#q40 .cf-section-header h1').text('Week 2 Beginning '+$('#q45 input').val());
});
However, if the form is rejected back to the initiator the variables do not display on the form. In addition, once the form is submitted into Laserfiche the fields show up as undefined. I have seen in other posts that this happens because coverts the data to read-only, and I altered to code to fix this issue, but I have not been successful. 'begindate' is date field as well as '#q45'.
Any ideas on what needs to be adjusted?