MargateSteve Posted August 11, 2011 Share Posted August 11, 2011 I have searched for a solution to this but as I am not quite sure what I am searching for (as the title may prove) I have had no joy. The term I have used is the way it is described in PHPMaker. What I am looking to do, is allow a user to select an option, via a drop down menu populated from a MySQL table, but if the option is not there, they can then add the option without having to refresh the page. As a rough example, if I had a dropdown that allowed users to select their country, the database table may have id country 1England 2Scotland 3Wales If a user was from Ireland, I would like them to click on an 'Add Country' button, fill in a form on the same page, and on submitting, the option would be added to the table and appear in the dropdown. If anyone can explain what term I need to search for, I would be grateful. Thanks in advance Steve Quote Link to comment https://forums.phpfreaks.com/topic/244520-add-to-mysql-dropdown-list-on-the-fly/ Share on other sites More sharing options...
sunfighter Posted August 13, 2011 Share Posted August 13, 2011 Since you are changing the HTML and your database to include a new country with out a page refresh I think your looking for AJAX techniques. This might help get you started http://www.openjs.com/articles/ajax_xmlhttp_using_post.php Quote Link to comment https://forums.phpfreaks.com/topic/244520-add-to-mysql-dropdown-list-on-the-fly/#findComment-1256810 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.