sayedsohail Posted June 9, 2007 Share Posted June 9, 2007 Hi everyone, I am able to populate data in a dropdown list box using php and mysql. However, I a wondering if i can add inside some icons such as close or More records, where the drop down acts to the specified request, ie., closing the drop down or fetching some more data from backend. Any advise would be greatly appreciated. Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/54861-dropdown-list-box-and-a-close-button-inside/ Share on other sites More sharing options...
sayedsohail Posted June 9, 2007 Author Share Posted June 9, 2007 here is code, which i wish to populate right at the bottom of the input field coordinates. <?php session_start(); require_once("db.php"); ?> <html> <head> <script type="text/JavaScript"> // script for popup window function doStuff() { /* If you use this to open a popup window and want to refer the value from parent window. var tb1=window.opener.document.getElementById('tb1'); */ var tb1=document.getElementById('tb1'); var s=document.getElementById('sel1'); tb1.value=s.options[s.selectedIndex].value; // if you want to close the popup window window.close(); } </script> </head> <select id="sel1"> <option value="option1">Option 1</option> <option value="option2">Option 2</option> <option value="option3">Option 3</option> </select> ... <input type="button" value="Close" onClick="doStuff();" /> <input type="text" id="tb1" /> </html> <? mysql_close($conn); require_once("footer.php"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/54861-dropdown-list-box-and-a-close-button-inside/#findComment-271338 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.