100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > 织梦DedeCMS自定义表单中加入用户提交时间

织梦DedeCMS自定义表单中加入用户提交时间

时间:2024-03-13 19:55:50

相关推荐

织梦DedeCMS自定义表单中加入用户提交时间

一 | 在自定义表单中添加字段

添加时间字段 timesj

二 | 在调用表单的页面中加入

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;

}

或者

此种方法好像生成的时间是静态的。

或者

var wdtime= new Date(); document.getElementById(“timesj”).value=wdtime.toLocaleString();

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

三 | 在系统模板中添加

plus/diy_list.htm 42的else前面或后面加入

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

{

$fields[$field] = GetDateTimeMk($fields[$field]);

}

经过以上三步的处理,用户在前台填表后,管理后台就能看到用户添加的时间了。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。