jaustill
12-19-2009, 06:49 PM
Script: DHTML Window widget
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
I am trying to use the DHTML Window widget with a form to pop window.
I am trying to use the iframe example, but can not seem to get the code correct.
The window pops but the variables do not post. Below is what I am using.
This is the main page that calls the pop-up and sends the variables
<html>
<head>
<title>Order Processing System </title>
<link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="windowfiles/dhtmlwindow.js">
/***********************************************
* DHTML Window Widget- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script>
function popchangeaction(myForm) {
var w = dhtmlwindow.open("changeaction", "iframe", "op-doad.php", "Change the action", "width=200px,height=200px,resize=1,scrolling=1,left=10px,top=10px");
}
</script>
</head>
<body>
<?php
$edit_time = date('M d Y g:iA', strtotime('now'));
$order_no = '987652';
print "<table>
<tr>
<td>Order No</td>
<td>action_code</td>
</tr>";
?>
<?php
print " <tr>
<td>$order_no</td>
<td>
<FORM target='_iframe-changeaction' action='op-doad.php' method='POST'><input type='hidden' value='$order_no' name='order_no'>
<select type='submit' name='action_code' onchange='popchangeaction(this)'><option value='' selected>blank</option>
<option value='selection1'>selection1</option>
<option value='selection2'>selection2</option>
</select>
</font></td></tr></table></form>';
?>
</body>
</html>
This is the page that should be in the popup and receive the posted variables
<html>
<head>
<title>TITLE</title>
</head>
<body>
<?php
$edit_time = date('M d Y g:iA', strtotime('now'));
$order_no = $_POST['order_no'];
$new_action_code = $_POST['action_code'];
echo'Your order has been submitted for processing.<br />';
echo'<br />';
echo'edit_time';
echo'<br />';
echo $edit_time;
echo'<br />';
echo'order_no';
echo'<br />';
echo $order_no;
echo'<br />';
echo'action_code';
echo'<br />';
echo $new_action_code;
echo'<br />';
echo 'The database has been updated!';
?>
</body>
</html>
http://www.dynamicdrive.com/dynamicindex8/dhtmlwindow/
I am trying to use the DHTML Window widget with a form to pop window.
I am trying to use the iframe example, but can not seem to get the code correct.
The window pops but the variables do not post. Below is what I am using.
This is the main page that calls the pop-up and sends the variables
<html>
<head>
<title>Order Processing System </title>
<link rel="stylesheet" href="windowfiles/dhtmlwindow.css" type="text/css" />
<script type="text/javascript" src="windowfiles/dhtmlwindow.js">
/***********************************************
* DHTML Window Widget- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>
<script>
function popchangeaction(myForm) {
var w = dhtmlwindow.open("changeaction", "iframe", "op-doad.php", "Change the action", "width=200px,height=200px,resize=1,scrolling=1,left=10px,top=10px");
}
</script>
</head>
<body>
<?php
$edit_time = date('M d Y g:iA', strtotime('now'));
$order_no = '987652';
print "<table>
<tr>
<td>Order No</td>
<td>action_code</td>
</tr>";
?>
<?php
print " <tr>
<td>$order_no</td>
<td>
<FORM target='_iframe-changeaction' action='op-doad.php' method='POST'><input type='hidden' value='$order_no' name='order_no'>
<select type='submit' name='action_code' onchange='popchangeaction(this)'><option value='' selected>blank</option>
<option value='selection1'>selection1</option>
<option value='selection2'>selection2</option>
</select>
</font></td></tr></table></form>';
?>
</body>
</html>
This is the page that should be in the popup and receive the posted variables
<html>
<head>
<title>TITLE</title>
</head>
<body>
<?php
$edit_time = date('M d Y g:iA', strtotime('now'));
$order_no = $_POST['order_no'];
$new_action_code = $_POST['action_code'];
echo'Your order has been submitted for processing.<br />';
echo'<br />';
echo'edit_time';
echo'<br />';
echo $edit_time;
echo'<br />';
echo'order_no';
echo'<br />';
echo $order_no;
echo'<br />';
echo'action_code';
echo'<br />';
echo $new_action_code;
echo'<br />';
echo 'The database has been updated!';
?>
</body>
</html>