首页 > 教程 >
织梦dedecms自定义表单显示提交时间的方法
2023-04-01教程围观次
简介文章介绍1、添加自定义字段:提交时间-->tijiaoshijian2、在模版中添加如下代码即可window.onload=function(){varnowDate=newDate();varstr=nowDate.getFullYear()+"-"+(nowDate.getMonth()+1)+"-"+nowDate.getDate()+""+nowDate.getHours()+":"+no
文章介绍
1、添加自定义字段:提交时间-->tijiaoshijian
2、在模版<form></form>中添加如下代码即可
<input name="tijiaoshijian" value="" type="hidden" id="tijiaoshijian" />
< type="text/ ">
window. = 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;
}
</ >
1、添加自定义字段:提交时间-->tijiaoshijian
2、在模版<form></form>中添加如下代码即可
<input name="tijiaoshijian" value="" type="hidden" id="tijiaoshijian" />
< type="text/ ">
window. = 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;
}
</ >
下载链接:网站源码/小程序源码/网站模板下载