1

I am working on something like there will be select dropdowns. a datatable below will be filtered as per dropdown selection. And there's a button - Reset, in which if its pressed the filter and sorting will be back to normal. Problem is when I reset table, which changes dropdown value and text, it doesn't change the selected option text - view all (when reset), but value works fine.

Select Dropdown

    <div class="input-group-prepend">
        <div class="input-group-text">
            Order Status
        </div>
    </div><!-- input-group-prepend -->
    <select name="orderStatus" id="orderStatus" class="statusbox SlectBox form-control">
        <?php echo status(); ?>
    </select>

Reset Button

$('#resetTable').click(function() {
    $("select.statusbox").val($("select.statusbox option:first").val()).change();       
});

where I am making the mistake? Video: streamable.com/fdz5q1

Roshan Zaid
  • 336
  • 1
  • 4
  • 21

1 Answers1

0

YOu can some of the below things as per this solution:

Set the selected index of a Dropdown using jQuery

Let me know if case you want more help.

Puneet Goel
  • 99
  • 1
  • 9