Jump to content
Larry Ullman's Book Forums

Popup Window Inside Of The First Popup Window


Recommended Posts

Aloha to everyone.

 

I am trying to give some editing options to users and am trying to work with opening additional windows and having some problems. The first additional window is opened with the following code and is working correctly.

 

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {

$bg = ($bg=='#eeeeee' ? '#ffffff' : '#eeeeee'); // Switch the background color.

echo '<tr bgcolor="' . $bg . '">

<td align="left"><a href="view_full_record_form.php?rec_id=' . $row['rec_id'] . '" onclick="window.open(this.href, \'popupwindow\',\'width=1000,height=800,left=200, top=50, scrollbars=yes,resizable=yes\');return false;">' . $row['rec_id'] . '</a></td>

 

Now I am trying to open another, smaller popup window inside of the existing window and am using the following code, but it is not opening another window and I can't see my problem.

 

<table align="center" cellspacing="0" cellpadding="5">

<tr>

<td><a href="form_selection.php" "onclick=window.open(this.href, \'popupwindow2\',\'width=800,height=600,left=30, top=10, scrollbars=yes,resizable=yes\');return false;"> Select and Prepare New Legal Form </a></td>

</tr>

</table>

 

Thank you for any help that you can provide.

 

Mahalo

 

dickm

PHP 5.3.1

MYSQL 5.1.41

Link to comment
Share on other sites

I'm not exactly sure what you mean by opening another popup window "inside" another window, since popup windows are, by definition, outside of windows. Regardless, if you're using a browser with a JavaScript console, it might show some meaningful errors.

Link to comment
Share on other sites

Sorry for the confusion Larry, so I must not be explaining myself properly. The initial display of data is a grouping of records and fields of information in rows. Each row of the ten row display has the rec_id at the left and it is underlined with the href tag. When the user selects one of the records the in the top code, a second window is opened with the sizes in the code that is smaller than the initial display of the records , and in this window is display all the fields of information related to that record. What I want to do with the second set of coding is all the user to again click on an href tag that will display some additional information in a third window but smaller than the second window.

 

This way they can close the smallest (third window) and still be able to access information from the second window before also closing that window and returning to the original display of ten records.

 

Hope this helps.

 

dickm

Link to comment
Share on other sites

Okay Larry, I have changed the code as follows which includes some height and width changes just for visual testing and it is not opening an additional window.

 

<table align="center" cellspacing="0" cellpadding="5">

<tr>

<td><a href="form_selection.php" onclick=window.open(this.href, \'popupwindow2\',\'width=600,height=400,left=30, top=10, scrollbars=yes,resizable=yes\');return false;"> Select and Prepare New Legal Form </a></td>

</tr>

</table>

 

Mahalo,

Link to comment
Share on other sites

Okay Larry, I have changed the code as follows and it still is not opening an additional window.

 

<table align="center" cellspacing="0" cellpadding="5">

<tr>

<td><a href="form_selection.php" onclick="window.open(this.href, \'popupwindow2\',\'width=600,height=400,left=30, top=10, scrollbars=yes,resizable=yes\');return false;"> Select and Prepare New Legal Form </a></td>

</tr>

</table>

 

Mahalo,

Link to comment
Share on other sites

I took the what should be the output of your code and tested it in two browsers and it worked for me in both (both popup windows worked). Here's the code I was testing, which should be what your PHP script it outputting:

 

 

<a href="form_selection.php" onclick="window.open(this.href, 'popupwindow2','width=600,height=400,left=30, top=10, scrollbars=yes,resizable=yes');return false;"> Select and Prepare New Legal Form </a>

<a href="view_full_record_form.php?rec_id=X" onclick="window.open(this.href, 'popupwindow','width=1000,height=800,left=200, top=50, scrollbars=yes,resizable=yes');return false;">Some Title</a>

 

Link to comment
Share on other sites

Thanks a million Larry, you are the best.

 

It was my forward slashes that came from some testing with htmlentities and addslashes and once removed like your code that you tested, all is well in my world again.

 

Mahalo,

 

ps...just received my ordered copy of your book "Effortless Flex 4 Development" and am looking forward to seeing what can be done.

Link to comment
Share on other sites

 Share

×
×
  • Create New...