I'm using this method to filter my SharePoint webpart with a dropdown box. I got it working fine. But I would like to be able to expand on this, and have multiple dropdowns that filter different columns, and have each dropdown work together.
For example: If I have one dropdown for 'username' and then another drop down for 'status'
Currently if the user select the 'username' dropdown, they can filter and get the selected username. But if they also only want 'active' from the status dropdown, once they make the selection from the status field, the 'username' selection is no longer included in the filter.
I think I just need to somehow add to the query string, when the second selection is made. Because if I manually type the string into the address bar, it all works.
Example: mypage.aspx?username=Chris&status=active
That correctly filters my webpart.
Here is parts of my current code related to the dropdowns and filters.
<script>function HandleFilterSelection(filterpath, parameter, selection) {
document.location.href = filterpath + "?" + parameter + "=" + selection; } </script>
and the dropdowns:
<select size="1" onchange="HandleFilterSelection('collateral_tracker.aspx', 'categoryselect', this.options[selectedIndex].value)" style="width: 211px" name="C1">
<select size="1" onchange="HandleFilterSelection('collateral_tracker.aspx', 'contentowner', this.options[selectedIndex].value)" name="C2">