I have a select
field and need to query and load the result dynamically with Ajax
. I currently have the following code (which does not seem to work or is incomplete) :
$('#formProd select').change(function(){
$.ajax({
type : 'POST',
url : 'index.php/home',
data : {id : $('#formProd select option:selected').val()}
});
});
How do I get this id for me to do my query ?
I want, by selecting an option from select
, that on that same page it takes the value of select
and makes an inquiry in my database to bring me the results.
See example .
When you click on a category, I want you to load a list with the products next to it.