[Fixed]-Django. How to show and hide DIV based on the selection of the dropdown menu?

1👍

I have solved the problem.
For those who might be interested, I changed

$('#pack-method').on('change', function() {
       if (this.value === 'Pallet') {
           $('#hidden2-1').show();
           $('#hidden2-2').hide();
       }
...
}

to

$('select').on('change', function() {
       var a = $(this).val();
       if (a === 'Pallet') {
          $('#hidden2-1').show();
          $('#hidden2-2').hide();
       }
...
}
👤smchae

Leave a comment