I am working on a form where a user can select a month from select dropdown list. What i am trying to do is when the user clicks a month then needed to display users information from the database according to the clicked month.
My problem is, here I dont use a submit button to send data to the server. I just need to display users information when clicking on a month form the select box.
Im looking for a PHP solution.
anybody can tell me how can I do this? or let me know af there is any good tutorials.
any comments are greatly appreciated.
Thank you.
Because php is server side you can’t have a server side only solution to this problem. You will need to capture the change event of the select box and reload the page or grab user data via ajax and load the content.
I recommend jQuery for the change event binding, http://api.jquery.com/change/
Jquery to do the ajax call to the server, http://api.jquery.com/jQuery.ajax/
and jQuery.html() to use the ajax response to replace the content of a div, http://api.jquery.com/html/
Quick search returns this example, on Change of dropdown list showld call the php function