本站资源均来自互联网,仅供学习与参考,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
Copyright @ 2015-2020 织梦园 版权所有
Power by DedeCms
鲁ICP备15039853号-1
鲁公网安备 37132302000249号
模板标签 TAG标签 网站地图 XML地图 今日更新 返回顶部
首先在自定义表单创建ip和liuyantime两个字段,用文本类型就行。
接下来去表单模板页面,将表单数据填写好,
再在下方添加js
<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("liuyantime").value=str; } </script> <script type="text/javascript" src="http://pv.sohu.com/cityjson/getip.aspx" charset="utf-8"></script> <script type="text/javascript"> var ip=returnCitySN.cip+"-"+returnCitySN.cname; document.getElementById("ip").value=ip; </script> |
效果如下图