javascript - display data from database based on drop down selection -
pls me. hav drop down contain shop , shop b.shop has value 1 , shop b has value 2. when select shop dropdown want list data database table corresponding each shop.. html
shop select >shopa >shopband js $("#shop").change(function(){
// selected user's id var id = $(this).find(":selected").val(); // load in userinfo div above $("#container").load("table_data.php?id="+id); });
does table_load.php
return html elements? jquery documentation:
description: load data server , place returned html matched element.
your php script needs generate html elements inserted container. also, don't need selector, sufficient:
var id = $(this).val();
Comments
Post a Comment