<var id="xvh3p"><noframes id="xvh3p"><var id="xvh3p"></var><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing>
<var id="xvh3p"><strike id="xvh3p"><var id="xvh3p"></var></strike></var><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<span id="xvh3p"><noframes id="xvh3p"><dl id="xvh3p"></dl>
<span id="xvh3p"><noframes id="xvh3p">
<dl id="xvh3p"><noframes id="xvh3p">
<listing id="xvh3p"><noframes id="xvh3p"><listing id="xvh3p"><strike id="xvh3p"><listing id="xvh3p"></listing></strike></listing><th id="xvh3p"><strike id="xvh3p"><th id="xvh3p"></th></strike></th>
<th id="xvh3p"><strike id="xvh3p"></strike></th>
<dl id="xvh3p"><noframes id="xvh3p">
<th id="xvh3p"><noframes id="xvh3p">

观点

互联网+时代,说建站,谈运营与网络营销

dedecms自定义表单中加入用户提交时间

时间:2020-12-15

一、在自定义表单中添加字段
添加时间字段 timesj
二、在调用表单的页面中加入

<input name="timesj" value="" type="hidden" id="timesj" style="width:250px" class="intxt">

<script type="text/javascript">
window.onload = function(){
var nowDate = new Date();
var str = nowDate.getFullYear()+"-"+(nowDate.getMonth() + 1)+"-"+nowDate.getDate()+" "+nowDate.getHours()+":"+nowDate.getMinutes()+":"+nowDate.getSeconds();
document.getElementById("timesj").value=str;
}
</script>

或者
<input type="hidden" name="timesj" id="timesj" value="{dede:php} echo $showtime=date('Y-m-d H:i:s');{/dede:php}">
此种方法好像生成的时间是静态的。

或者
<input type='hidden' name='timesj' id='timesj'/>
<script  language="javascript" type="text/javascript">   var wdtime= new Date();   document.getElementById("timesj").value=wdtime.toLocaleString(); </script>

以上表单中使用了type=hidden,所以是隐藏模式。

三、在系统模板中添加
plus/diy_list.htm 42的else前面或后面加入

if($fielddata[1]=='datetime')

{
    $fields[$field] = GetDateTimeMk($fields[$field]);
}
经过以上三步的处理,用户在前台填表后,管理后台就能看到用户添加的时间了。
0
首页
案例
关于
联系