A Bootstrap modal is part of the same page, so you should be able to do something like this:
$('#myModal').on('hidden.bs.modal', function (e) {
var value = $('#myPopupInput').val();
$('#myMainPageInput').val(value);
});
NB: If you only want the code to run when the "Save changes" button is clicked, then you'll want to attach the handler to the click event of that button instead:
$('#myModal').on('click', '.btn-primary', function(){
var value = $('#myPopupInput').val();
$('#myMainPageInput').val(value);
$('#myModal').modal('hide');
});