onchange js
<script>
document.getElementById("fname").addEventListener("change", myFunction);
function myFunction() {
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
javascript добавя функцията на събитието onchange
transport_select.setAttribute("onchange", function(){toggleSelect(transport_select_id);});
// or
transport_select.onchange = function(){toggleSelect(transport_select_id);};