console.log("updateRecipient");
var form = document.getElementById('contact_form'); function updateRecipient() {
var recipientEl = document.getElementsByName('recipient')[0]; var sector = document.querySelector('input[name="Sector"]:checked').value;
recipientEl.value = 2; console.log(recipientEl); } var inputs = form.getElementsByTagName('input'); for (var i = 0; i < inputs.length; i++) console.log("recipientEl"); inputs[i].onchange = updateRecipient;