As the headline is short, the work is simple. Look at the following code
It binds the change function to all select on the page and get the special attribute value "ttMailActorTo" and append it to a hidden field "ttMailActorTo".
Simple as that. Enjoy.
$('select').on('change', function () {
var ttMailActorTo = $('option:selected', this).attr('ttMailActorTo');
if (isEmail(ttMailActorTo))
$('#ttMailActorTo').val(ttMailActorTo);
});
It binds the change function to all select on the page and get the special attribute value "ttMailActorTo" and append it to a hidden field "ttMailActorTo".
Simple as that. Enjoy.