Jump to content

page changes onchange - change the location window...


wmguk

Recommended Posts

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

<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>

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.