,我们在做自定义表单的时候,不得不添加一个时间字段,但是,为了方便用户不去手动添加,所有我们让系统自动获取填写的时间。,下面我来说下具体操作步骤:,<input type='hidden' name='shijian' id='shijian' placeholder="" >
<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("shijian").value=str;
}
</script>