$("#selectMenuId").bind("change", function(event) {
var selectedID = event.target.value;
$.post("path/to/your/serverSide.php", {
selectionID: selectedID
}, function(data) {
$("#myContainer").html(data);
});
});
And on serverSide.php
you would want to do something like this
if(isset($_POST["selectionID"])) {
$sql = "SELECT * FROM someTable WHERE category_id = " . $_POST["selectionID"] . ";
// run your query, build your new results, echo them back.
}
The basic id is you are passing the selected value to the serverSide page, running a query against the DB with the (i would assume some sort of category ID) value, build your new resultset and return it. Without knowing how you are building the list currently I wouldn't be able to help further.
Edit
To show a loader you can do something like this?
$("#selectMenuId").bind("change", function(event) {
var selectedID = event.target.value;
var container = $("#myContainer");
container.html("Loading...");
$.post("path/to/your/serverSide.php", {
selectionID: selectedID
}, function(data) {
container.html(data);
});
});
Or you can have a overlay with a loading gif, and just $("#loadingLayer").show()/.hide() for that.
as for the default selection.. you could (using your ServerSide language) have the default view rendered on the page. or you can have it collected via JS the same way you have the rest of your results... just wait for the list to load and trigger a 'change'
$("#selectMenuId").bind("change", function(event) {
var selectedID = event.target.value;
var container = $("#myContainer");
container.html("Loading...");
$.post("path/to/your/serverSide.php", {
selectionID: selectedID
}, function(data) {
container.html(data);
});
}).trigger("change");
Hope this helps!