Hi,
sorry for delay, had to work on another area first.
Anyways, still havnt been able to figure this out and here is the code i have so far.
index.php
<div id="addOrder" class="easyui-panel" closed="true"></div>
<div id="dlgBlockRef" class="easyui-dialog" style="width:600px;height:420px;padding:10px"
data-options="
title: 'Block/Section reference?',
closed: false,
cache: false,
modal: true,
buttons: [{
text:'Ok',
iconCls:'icon-ok',
handler:function(){
addOrder();
}
},{
text:'Cancel',
iconCls:'icon-cancel',
handler:function(){
$('#fm').form('clear');
$('#dlgBlockRef').dialog('close');
}
}],
">
<form id="fm" method="post" enctype="multipart/form-data" novalidate>
<div class="fitem" id="bref">
<input id="block_ref" name="block_ref" label="Block Reference" class="easyui-textbox" labelWidth="200px" style="width:550px; height: 36px; line-height: 36px; padding-bottom: 10px;">
</div>
<div class="fitem">
<input id="order_note" name="order_note" label="Order notes" labelWidth="200px" class="easyui-textbox" style="width:550px;height:150px; line-height: 36px; padding-bottom: 10px;" multiline="true" labelPosition="left">
</div>
<HR>
<div class="fitem">
<input id="delay_po" name="delay_po" label="Delay Procesing" labelWidth="200px" type="text" class="easyui-datebox" style="width:550px;" data-options="panelWidth:500,panelHeight:500,tooltip:{content:'Leave BLANK to process immediately',position:'bottom'}">
</div>
<div class="fitem">
<label class="textbox-label" style="width: 190px; height: 36px; line-height: 36px;">HOLD Order Indefinitely</label>
<input id="hold_order" name="hold_order" class="easyui-switchbutton" style="width:179px" data-options="onText:'Yes',offText:'No'">
</div>
</form>
</div>
<script type="text/javascript">
function addOrder(){
var x = ($('#hold_order').switchbutton('options').checked) ? 1 : 0;
//url: 'new_panel.php?jobid=<?php echo $jobid ?>&blockref='+$('#block_ref').val()+'&delaypo='+$('#delay_po').val()+'&holdpo='+x+'&edit=0',
$('#fm').form('submit', {
url: 'new_panel.php?action=1',
onSubmit: function(param){
param.edit = 0;
//param.test = $('#block_ref').val();
param.test = "testtttt";
var isValid = $(this).form('validate');
if (!isValid){
$.messager.show({
msg:'Block/Section reference required',
timeout:4000,
showType:'slide'
});
}
return isValid;
},
success: function(data){
alert(data);
//data.test = "$('#block_ref').val()";
var x = ($('#hold_order').switchbutton('options').checked) ? 1 : 0;
$('#dlgBlockRef').dialog('close');
$('#addOrder').panel({
title: 'Add New Order',
closable: false,
fit: true,
closed: false,
href: 'new_panel.php?action=1',
});
}
});
};
</script>
new_panel.php
<?php
$blockRef = mysql_real_escape_string($_REQUEST['block_ref']);
$orderNote = htmlspecialchars($_REQUEST['order_note']);
$delayPO = mysql_real_escape_string($_REQUEST['delay_po']);
$holdOrder = htmlspecialchars($_REQUEST['hold_order']);
$edit = htmlspecialchars($_REQUEST['edit']);
$test = htmlspecialchars($_POST['test']);
$action = htmlspecialchars($_POST['action']);
if($action){
echo "test" . $test . "<BR>";
//exit;
} else {
echo "action" . $action . "<BR>";
echo "blockRef" . $blockRef . "<BR>";
echo "orderNote" . $orderNote . "<BR>";
echo "delayPO" . $delayPO . "<BR>";
echo "holdOrder" . $holdOrder . "<BR>";
echo "edit" . $edit . "<BR>";
echo "test" . $test . "<BR>";
$test2 = $_POST['test'];
echo "test2" . $test2 . "<BR>";
}
?>
<a href="#" iconCls="icon-cancel" class="easyui-linkbutton" onclick="closePanel()">Close</a><BR>
<script>
function closePanel(){
$('#addOrder').dialog('close');
$('#dlgBlockRef').dialog('open');
}
</script>
So, we have the initial form where the user will enter details.
When the form is submitted, the data gets posted (can see this in the alert box)
However, when the "success" is fired, it just loads the new_panel.php page but cannot get any of the posted values.
how do i go about passing those details to the new panel?