I dont know how much of either php or JS you know already. But assuming you can already set up a database connection and retrieve data etc. the only hard part is really in the usage of jQuery and combining it with php, which is actually rather easy.
You set an id to the drop down field (<select> tag), and then you can add handlers to it with jQuery, create function which will execute att certain events. Something like
Code:
<script language="javascript">
// This writing is standard and can be found on jQuery's site
$(document).ready(function(){
$('#you_select_id').select(function(){
// stuff to do on select value
// like using get or post (functions in jQuery) to call a php page,
// which will then retrieve stuff from the database and return it.
// You can then use that data here, in this function.
// Btw, to "return" data from the php page to the get/post functions
// you simply print them out. The whole string will be returned.
// You can also use json format to return variables, arrays etc.
// php already has functions for encoding/decoding json format
});
});
</script>
I know this isn't much but you wont need much more from me. There are tutorials and lots of examples/free scripts on jQuery's website, http://jquery.com/
I went through their beginners tutorial and used it as a reference, together with their acrticles and examples, and had little problems putting together all my scripts.
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
|