# Adding user filter - Not updating data in URL

## What I am trying to do

I am trying to add a filter option by adding a dropdown menu that i have hooked onto restrict_manage_users, so i can filter users by a specific meta value.

## My problem

When i choose an option from the dropdown and click submit, the data that is being sent (what i can see in the url) is only the first option even if i select another option it is still the first option that is being sent. If i then try to hardcode selected into the second option, then it changes so that it is only the second option that is being sent every time.

## Code

I have removed the foreach loop that loops through the companies and echoes them to the dropdown.

add_action( 'restrict_manage_users' , 'restrict_to_company' );

function restrict_to_company()
{
echo '<select name="company_sorting" id="company_sorting">';
echo '<option value="0">Select a company</option>';
echo '<option value="1">Company 1</option>';
echo '<option value="2">Company 2</option>';
echo '</select>';
echo '<input type="submit" class="button" value="Sort" />';
}


## Result

This is what i get in the URL after the domain name.
/wp-admin/users.php?s&action=-1&company_sorting=0&paged=1&action2=-1

document.getElementsByClassName("companyDropdown")[1].innerHTML = "";
And then wrapped the dropdown in a div with the class companyDropdown.