织梦dedecms自定义表单显示提交时间的方法

2024年05月06日 织梦 dedecms 自定义 表单 显示 提交 懒猪技术

1、添加自定义字段:提交时间-->tijiaoshijian
2、在模版<form></form>中添加如下代码即可
<input name="tijiaoshijian" value="" type="hidden" id="tijiaoshijian" />
<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("tijiaoshijian").value=str;
}
</script>

本文链接:http://so.lmcjl.com/news/3877/

展开阅读全文
相关内容