List selected checkboxes

0

I have a question regarding a function, how do I display the selected checkbox and combobox values in real time? For example, if I select option 1 of the combobox and a checkbox option the two appear in list format.

Ex:

List Option 01 - Combobox Option 01 - Checkbox

    
asked by anonymous 27.04.2018 / 20:45

1 answer

0

You can do this using Javascript. Create a function that will be executed whenever you change the value, in the function you can write in the console using console.log () or put in an alert () or even write in the html $ ("# div") innerHtml (). It would look something like this:

<script> $(document).ready(function(){ $('#combo').on('change', function (e) { var opcaoSelecionada = $("option:selected", this); var valueSelected = this.value; alert(valueSelected); }); }); </script>

    
27.04.2018 / 21:04