timmah1 Posted May 14, 2008 Share Posted May 14, 2008 Hello, I have a page (http://www.cheezyfries.net/plumbing/new_job.php) that you can input a new job with certain fields. In the drop down menus, that are generated from the database, if your item isn't listed, you can list it by clicking a link that pops up a new window, you input the new item, and then close the window. How can I make it so that just that field (drop-down menu) gets refreshed to show the new item without refreshing the whole page? Any help would be greatly appreciated. Thanks in advance Link to comment https://forums.phpfreaks.com/topic/105600-solved-refresh-page-after-inserting/ Share on other sites More sharing options...
947740 Posted May 14, 2008 Share Posted May 14, 2008 You could use <div> tags, and you could replace the information in the <div> tags. You will have to think about it a little bit, but it is possible. Link to comment https://forums.phpfreaks.com/topic/105600-solved-refresh-page-after-inserting/#findComment-541033 Share on other sites More sharing options...
timmah1 Posted May 14, 2008 Author Share Posted May 14, 2008 Why do you think I'm on here posting the question? I have been thinking about it, doing searches and everything in between. The forums are always my last resort Link to comment https://forums.phpfreaks.com/topic/105600-solved-refresh-page-after-inserting/#findComment-541038 Share on other sites More sharing options...
nogray Posted May 14, 2008 Share Posted May 14, 2008 In you main page you'll need to add a function to add an option to the select i.e. function add_option(val, txt){ var opt = document.createElement("option"); opt.value = val; opt.txt = txt; document.getElementById('MY_SELECT_ID').appendChild(opt); document.getElementById('MY_SELECT_ID').selectedIndex = document.getElementById('MY_SELECT_ID').options.length - 1; } Not Tested In the opened window, you'll need to call this function with the text and value; i.e. you're using a link <a href="#" onclick="window.opener.add_option('some value', 'some text'); window.close();">Select Me</a> Again Not Tested. Link to comment https://forums.phpfreaks.com/topic/105600-solved-refresh-page-after-inserting/#findComment-541086 Share on other sites More sharing options...
947740 Posted May 14, 2008 Share Posted May 14, 2008 I was trying to give you a jumping-off point. Link to comment https://forums.phpfreaks.com/topic/105600-solved-refresh-page-after-inserting/#findComment-541153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.