Adding OnChange-post to the drop file?

How do you submit a form in mvc when changing the value of the dartist? Do I need to add attributes or is there some kind of built-in thing?

thanks

/ M

+3
source share
1 answer

Can't you do something similar, beautiful and clean:

<script>
document.getElementById('mySelect').onchange = function() {
    document.forms[0].submit();
};
</script>


<form method="post">
    <select id="mySelect">
        <option>foo</option>
        <option>bar</option>
    </select>
</form>
+3
source

Source: https://habr.com/ru/post/1718698/


All Articles