我喜欢在jeasyui框架的模态对话框中打印带有doc编号的var。我知道如何将var放在textbox中,但仍然有问题在超链接中打印var(带有doc号的ID),有人知道如何打印var与echo中的相同PHP。
非常感谢!,
约翰。
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
<script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript">
function editDoc(){
var row = $('#dg').datagrid('getSelected');
if (row){
$('#dlg').dialog('open').dialog('setTitle','Edit Documents');
$('#fm').form('load',row);
url = 'easyui/update_doc.php?HID='+row.HID;
}
}
function SaveDocInfo(){
$('#fm').form('submit',{
url: url,
onSubmit: function(){
return $(this).form('validate');
},
success: function(result){
var result = eval('('+result+')');
if (result.success){
$('#dlg').dialog('close'); // close the dialog
$('#dg').datagrid('reload'); // reload the user data
} else {
$.messager.show({
title: 'Error',
msg: result.msg
});
}
}
});
}
</script>
</head>
<body>
<div id="dlg2" class="easyui-dialog" closed="true" title="Basic Dialog" data-options="iconCls:'icon-save'" style="width:400px;height:200px;padding:10px"> The dialog content. </div>
<h2>DocumentSearch</h2>
<table id="dg" title="Documents" class="easyui-datagrid" style="width:800px;height:1000px"
url="easyui/get_documents.php"
toolbar="#toolbar" pagination="true"
rownumbers="true" fitColumns="true" singleSelect="true" pagesize="30">
<thead>
<tr>
<th field="HID" width="50">HID</th>
<th field="Type" width="50">Type</th>
<th field="DocumentDate" width="100">DocumentDate</th>
<th field="Name" width="150">Account</th>
<th field="Subject" width="200">Subject</th>
<th field="AmountFC" width="60">Amount</th>
<th field="PurchaseInvoiceNumber" width="60">Booking</th>
</tr>
</thead>
</table>
<div id="toolbar">
<a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editDoc()">Edit Document</a>
</div>
<div id="dlg" class="easyui-dialog" style="width:600px;height:400px;padding:10px 20px"
closed="true" buttons="#dlg-buttons">
<div class="ftitle">DocumentInformation</div>
<form id="fm" method="post" novalidate>
<div class="fitem">
<table width="400" border="1">
<tr>
<td>HID</td>
<td><input name="HID" type="" class="easyui-validatebox" readonly="True" data-options="min:0,precision:2"></td>
</tr>
<tr>
<td>TYPE</td>
<td> <select class="easyui-combobox" name="Type" data-options="
url:'combobox_data2.php',
method:'get',
valueField:'Type',
textField:'Type',
panelHeight:'auto',
width:300">
</select></td>
</tr>
<tr>
<td>ACCOUNT</td>
<td>
<input class="easyui-combobox" name="Account"
data-options="
url:'combobox_data1.php',
method:'get',
valueField:'ID',
textField:'Name',
panelHeight:'auto',
width:300"> <a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#dlg2').dialog('open')">AddNew</a>
</td>
</tr>
<tr>
<td>Date</td>
<td><input name="DocumentDate" type="" class="easyui-validatebox" style="width:300px"></td>
</tr>
<tr>
<td>SUBJECT</td>
<td><input name="Subject" type="" class="easyui-validatebox" style="width:300px"></td>
</tr>
<tr>
<td>AMOUNT</td>
<td><input name="AmountFC" type="text" class="easyui-numberbox" data-options="min:0,precision:2">
</td>
</tr>
<tr>
<td>Link</td>
<td><a href="<?php echo "http://XX.XXX.XXX.XX/FileServer/".$_SESSION[AdminID]."/Documents/<??????????????>.pdf"; ?>" target="_new"><?php echo "DocLink"; ?></a></td>
</tr>
<tr>
</td>
</tr>
</table>
</form>
答案 0 :(得分:0)
你可以这样尝试
<a href="<?php echo 'http://XX.XXX.XXX.XX/FileServer/'.$_SESSION[AdminID].'/Documents/'.$var_doc-id.'pdf'; ?>" target="_new">