/ Replace 'originating_page' with your hidden field's actual name or ID
window.addEventListener('DOMContentLoaded', function() {
var hiddenField = document.querySelector('input[name="originating_page"]');
if (hiddenField) {
hiddenField.value = document.title + ' (' + window.location.href + ')';
}
});