wmguk Posted November 14, 2008 Share Posted November 14, 2008 Hi, I have a page that shows a drop down list of users. once you select a user I want a page to open up to edit the user info. I dont know if just using an iframe is the best way, but if it is then I have this script on my php page: <form> <select name="direct" class="general" onchange="window.location=this.options[this.selectedIndex].value;"> <option selected="selected">- Select -</option> <option value="editu.php?username=<?php echo $row['username']; ?>"><?php echo $row['name']; ?></option> </select> </form> but I want it to pop up the editu.php page in a different window... how can i do that? Cheers Link to comment https://forums.phpfreaks.com/topic/132706-page-changes-onchange-change-the-location-window/ Share on other sites More sharing options...
rhodesa Posted November 14, 2008 Share Posted November 14, 2008 <select name="direct" class="general" onchange="if(this.selectedIndex) window.open('editu.php?username='+this.options[this.selectedIndex].value);"> <option selected="selected">- Select -</option> <option value="<?php echo $row['username']; ?>"><?php echo $row['name']; ?></option> </select> Link to comment https://forums.phpfreaks.com/topic/132706-page-changes-onchange-change-the-location-window/#findComment-690142 Share on other sites More sharing options...
wmguk Posted November 14, 2008 Author Share Posted November 14, 2008 Hi, Thanks for that, how can I specify the name of the window it needs to display in, because if i want it to display in an iframe i need to set the name etc... Link to comment https://forums.phpfreaks.com/topic/132706-page-changes-onchange-change-the-location-window/#findComment-690143 Share on other sites More sharing options...
rhodesa Posted November 14, 2008 Share Posted November 14, 2008 well...and iframe won't be a new window...the new window could have an iframe, but that seems silly... are you trying to have it where there is an iframe below the SELECT list that changes to editu.php page for the selected user? <select name="direct" class="general" onchange="if(this.selectedIndex) document.getElementById('editu').src = 'editu.php?username='+this.options[this.selectedIndex].value;"> <option selected="selected">- Select -</option> <option value="<?php echo $row['username']; ?>"><?php echo $row['name']; ?></option> </select><br /> <iframe id="editu"></iframe> Link to comment https://forums.phpfreaks.com/topic/132706-page-changes-onchange-change-the-location-window/#findComment-690147 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.