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 Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.