im using folowing search database :
<script type="text/javascript"> $(function() { $("#lets_search").bind('submit',function() { var cat1 = $('#cat1').val(); $.post('db.php',{cat1:cat1}, function(data){ $("#search_results").html(data); }); return false; }); }); </script>
cat1 id of drop down box. want add drop down box query :
select * business category='".$_post['cat1']."' , subcategory='".$_post['cat2']."'
i cant seem javascript work more 1 drop down. have tried , didnt work.
<script type="text/javascript"> $(function() { $("#lets_search").bind('submit',function() { var cat1 = $('#cat1').val(); var cat2 = $('#cat2').val(); $.post('db.php',{cat1:cat1},{cat2:cat2}, function(data){ $("#search_results").html(data); }); return false; }); }); </script>
you constructing data in wrong wya. try -
$.post('db.php',{cat1:cat1,cat2:cat2}, function(data){ ...
Comments
Post a Comment