zkagenotora Posted December 28, 2010 Share Posted December 28, 2010 I'm relatively new to Ajax and Javascript. However, I have a good background of PHP. I came across this website: http://www.babycarers.com/search?searchref=12935259587085&specreq=all&postcode=Postcode%2FZip+%28optional%29&country=CA&searchbutton.x=38&searchbutton.y=12 As you can see, when I click on the check-box, it filters out the result. How can I do it? I have been looking for check-box filtering, but, I couldn't find tutorial that quite like it. I might have missed it somewhere. Please advice me. Thanks:) Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/ Share on other sites More sharing options...
trq Posted December 28, 2010 Share Posted December 28, 2010 It's simply a matter of executing a new Ajax request (based on the new selections) whenever a form element changes. Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1152067 Share on other sites More sharing options...
zkagenotora Posted December 29, 2010 Author Share Posted December 29, 2010 Thanks a lot. However, I am new to Ajax. Do you happen to know tutorial related to this somewhere? Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1152672 Share on other sites More sharing options...
shayward2003 Posted December 29, 2010 Share Posted December 29, 2010 I was looking for a tutorial, but i can't find one, sadly, so i guess i will just try to walk you through it.... how i would make the example you provided is first create a mysql database filled with the info (that is what the baby carers is a large database of carers in Canada) after that create a php file that displays all the information however you want it to be displayed..... when first creating this just "SELECT * FROM Table" this will display the whole database for you ( you can add the queries in later). after you have that file you can begin the creating the front end.... basically there will be a couple parts to this - javascript/ajax script connecting you to the .php file - javascript code that checks the checkboxes if they are checked, and then creates a variable to be passed onto the .php file - html code displaying the checkbox options - <div> container where the .php results will be shown.. - and finally javascript/ajax code displaying the results from the .php in the <div> container.... it can be a bit complicated to try to explain.... so what you should dofirst... is create a database with info in it, and a .php file that displays all that info in a table (or list),and an .html file with your query options (checkboxes) and a container looking like this <div id="results"></div> after that let me know where i can find it online and i will walk you through connecting it all together... Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1152691 Share on other sites More sharing options...
zkagenotora Posted December 29, 2010 Author Share Posted December 29, 2010 Thanks Shawn, I will read your suggestions and update you accordingly. Awesome! Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1152704 Share on other sites More sharing options...
red71chevelle Posted November 16, 2011 Share Posted November 16, 2011 Hey sorry to dig this back up but this is EXACTLY what I am looking to do and I am in need of some help. I am new to all of this coding but I am learning. I learn by example and that seems to be an issue for some of this. I am looking to add a list of different things on my site exactly like the baby stroller site. I want a list of all of the items then as a user checks the filter on the left side it updates the display to show just what the user is looking for. I also will be using MySQL for the data base but I have no idea where to start on the table displaying all the items and filtering them out with check boxes. Again I learn from example so any form of Code to show me how I can do this would be AWESOME! Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1288749 Share on other sites More sharing options...
red71chevelle Posted November 18, 2011 Share Posted November 18, 2011 Anyone know? Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1289406 Share on other sites More sharing options...
mspace Posted December 6, 2011 Share Posted December 6, 2011 Hello, I am looking exactly the same! please did you figure out how to make it work? thank you! Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1294836 Share on other sites More sharing options...
red71chevelle Posted December 6, 2011 Share Posted December 6, 2011 No I have not I am still looking Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1294895 Share on other sites More sharing options...
hal_11 Posted December 9, 2011 Share Posted December 9, 2011 Am also interested in figuring out a solution to this...anybody n e ideas?? Quote Link to comment https://forums.phpfreaks.com/topic/222798-ajax-checkbox-filter/#findComment-1296173 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.