名站网址导航为大驾家提供DedeCMS站点程序站点教程相关的知识,比如织梦程序安装教程,织梦程序系统故障等教程。DEDE的自定义表单功能,可以用来实现站点留言,下面就是制作的相关具体操作方法,并且还能够在网站的后台显示访客提交数据的时间,很直观。
<form action="/plus/diy.php" enctype="multipart/form-data" method="post">
<input type="hidden" name="action" value="post" />
<input type="hidden" name="diyid" value="1" />
<input type="hidden" name="do" value="2" />
<table style="width:97%;" cellpadding="0" cellspacing="1">
<tbody><tr>
<td align="right" valign="top">用户角色:</td>
<td><input type="radio" name='xuesheng' class='np' value='家长' checked>家长
<input type="radio" name='xuesheng' class='np' value='学生'>学生
</td>
</tr>
<tr>
<td align="right" valign="top">用户姓名:</td>
<td><input required type="text" name='name' id='name' style="width:250px" class="intxt aiaedu_name" value=""> <span class="whitecolor">*</span>
</td>
</tr>
<tr>
<td align="right" valign="top">用户性别:</td>
<td><input type="radio" name='sex' class='np' value='男' checked>男
<input type="radio" name='sex' class='np' value='女'>女
</td>
</tr>
<tr>
<td align="right" valign="top">出生日期:</td>
<td><input type="text" name='time' id='time' style="width:250px" class="intxt" value="">
</td>
</tr>
<tr>
<td align="right" valign="top">邮寄地址:</td>
<td><input type="text" name='youbian' id='youbian' style="width:250px" class="intxt" value="">
</td>
</tr>
<tr>
<td align="right" valign="top">常用邮箱:</td>
<td><input type="email" name='email' id='email' style="width:250px" class="intxt" value="">
</td>
</tr>
<tr>
<td align="right" valign="top">手机号码:</td>
<td><input required type="text" name='telphone' id='telphone' style="width:250px" class="intxt aiaedu_phone" value=""> <span class="whitecolor">*</span>
</td>
</tr>
<tr>
<td align="right" valign="top">就读高中:</td>
<td><input type="text" name='school' id='school' style="width:250px" class="intxt aiaedu_school" value=""> <span class="whitecolor">*</span>
</td>
</tr>
<tr>
<td align="right" valign="top">备注网站内容:</td>
<td><textarea name='pscontent' id='pscontent' class="beizhu"></textarea>
</td>
<tr style="display:none;">
<td align="right" valign="top">提交时间:</td>
<td><input type="hidden" name='mytime' id='mytime' style="width:250px" class="intxt ft_time" value=""> //type=hidden就是不要其在前端显示,但是网站的后台可以看到。下面的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("mytime").value=str;
}
</script>
</td>
</tr>
</tr>
<input type="hidden" name="dede_fields" value="name,text;sex,radio;xuesheng,radio;tim
关于DedeCMS站点程序站点教程相关的知识,就说到这里了希望能帮助朋友们。DEDE自定义表单显示提交时间|添加提交时间,获取