<a onclick="window.open('ecmseditor/FileMain.php?type=1&classid=<?=$classid?>&infoid=<?=$id?>&filepass=<?=$filepass?>&sinfo=1&doing=1&field=slides_2_<?=$j?><?=$ecms_hashur[ehref]?>','','width=700,height=550,scrollbars=yes');" title="选择已上传的图片"><img src="../data/images/changeimg.gif" border="0" align="absbottom"></a>在点击事件的field后面传入表单input的id值,
然后把e/admin/ecmseditor/file.php中的函数ChangeFile1修改成为如下代码即可:
function ChangeFile1(obj,str){
<?php
if(strstr($field,'.'))
{
?>
parent.<?=$field?>.value=str;
<?php
}
else
{
?>
if(obj==1)
{
parent.opener.document.add.<?=$field?>.value=str;
if(typeof(parent.opener.document.add.<?=$field?>) == "undefined"){
parent.opener.document.add.<?=$field?>.value=str;
}else{
parent.opener.document.getElementById('<?=$field?>').value=str;
}
}
else
{
if(typeof(parent.opener.document.form1.<?=$field?>) == "undefined"){
parent.opener.document.form1.<?=$field?>.value=str;
}else{
parent.opener.document.getElementById('<?=$field?>').value=str;
}
}
<?php
}
?>
parent.window.close();
}如果本文对你有帮助,欢迎打赏本站

支付宝扫码打赏
微信扫码打赏
