Updating a form based on checkbox selection
Hi,
I'm working on a search filter trying to get a form to update itself depending on what options have been checked from a selection of checkboxes. i.e. selecting one checkbox can bring up other checkboxes. It's just posting the form to update_filter.php and putting the updated form into searchNavigation div.
- $(document).ready(function(e){
- $("input[type='checkbox']").change(function(e){
- e.preventDefault();
- update_filter();
- });
- function update_filter(){
- $.post("./update_filter.php", $("#filterform").serialize(), function(data){
- $("#searchNavigation").html(data);
- });
- }
- });
This works for the first checkbox that is checked, but after that nothing.
Is it something to do with the fact that the form is not the same form that it was before the checkbox was checked if that makes sense? or shouldn't that make any difference?
Can anyone point me in the right direction?
Thanks,
Tom.