資源檔案在文章最後的網盤連結裡,請先把大體流程看一遍
方法來自網上 整理後釋出,改進了幾處,比如表單資訊送出後不關閉架構,原文 formid值未提示修改,index.html第四處修改地方也不對等等!
将 ok.html success.html show_box.html三個檔案放在 www\phpcms\templates\default\formguide\
将mymydialog.css放如在 www\statics\css\
打開 www\phpcms\modules\formguide\index.php 修改(最好是注釋插入,不要直接修改)
46行 $_GET['action'] ? exit : showmessage(L('form_expired'), APP_PATH.'index.php?m=formguide&c=index&a=index'); 成 $_GET['action'] ? exit : showmessage(L('form_expired'), APP_PATH.'index.php?m=formguide&c=index&a=ok');
79行 showmessage(L('thanks'), APP_PATH); 成 showmessage(L('thanks'),APP_PATH.'index.php?m=formguide&c=index&a=success');
97行 $_GET['action'] ? exit : showmessage(L('had_participate'), APP_PATH.'index.php?m=formguide&c=index&a=index'); 成 $_GET['action'] ? exit : showmessage(L('had_participate'), APP_PATH.'index.php?m=formguide&c=index&a=ok');
在127行後添加 public function ok() { include template('formguide', 'ok'); } public function success() { include template('formguide', 'success'); }
背景建立表單 添加表單向導時的模版選擇改成 show_box.html 其他的按你的實際情況填 添加字段略
在模版檔案中,你想插入的留言闆連結的位置前 調加
打開表單向導後,在表單調用裡檢視src=''引号裡formid的值 留言闆的連結就是 javascript:art.dialog({id:'message',iframe:'? m=formguide&c=index&a=show&formid=20&siteid=1', title:'意見回報', width:'540', height:'360',drag: false,fixed: true,opacity: .5, lock:true});void(0); 将其中的formid的值,替換成你剛才檢視的值即可
檔案下載下傳 http://pan.baidu.com/s/1nt9lV2T