Filtering between Select Box Salary ranges

Filtering between Select Box Salary ranges

mckvrmckvr Posts: 1Questions: 1Answers: 0

I'm trying to filter Salaries in a DataTable using a select box but I'm not sure what I'm doing wrong.

Here's the select box:

    <select class="custom-select w-100" name="salary" id="salary">
    <option value="" selected="selected">Any salary</option>
    <option value="18000">£18,000 and below</option>
    <option value="28000">£28,000 and below </option>
    <option value="32000">£32,000 and below</option>
    <option value="40000">£40,000 and above</option>

And here's the query:

    $ (settings, data, dataIndex) {
          var salary = parseFloat( data[2].replace(",","") ) || 0;
          return salary <= parseInt($('#salary').val())
    $('#salary').on( 'change', function (data) {

Here's a link to the live version:

I've attached a picture of the table.

Does anyone know what I'm doing fundamentally wrong? I imagine it's something obvious..


  • tangerinetangerine Posts: 2,084Questions: 14Answers: 230

    One of your salaries is "Excellent", which can't be helping.

Sign In or Register to comment.