Yes, I am trying to set up a form that when it's submitted, the results load in the DHTML Window.
The only thing I changed from my first post was to put the DHTML widget call in the brackets after submit. I do not know if it was proper/correct to do that, I tried it and it just happened to work.
This is ALL of the code for BOTH pages, nothing in the dhtml window widget files called from the directory windowfiles was touched.
Code:
onchange='popchangeaction(this)'
to this
Code:
onChange='submit(popchangeaction(this))'
Below is ALL of the code on both of my pages.
The only other thing I would like to do is hide the widget after a few seconds instead of it staying on the screen.
This is the main page that calls the pop-up and sends the variables
Code:
<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 is be in the popup and receives the posted variables
Code:
<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>
Bookmarks