自定義表單在模板中修改如下:
<form action="/plus/diy.php" enctype="multipart/form-data" method="post" name="form" onsubmit="return CheckForm();"> <input type="hidden" name="action" value="post" /> <input type="hidden" name="diyid" value="1" /> <input type="hidden" name="do" value="2" /> 提交時(shí)間 <input name="mytime" value="" type="text" id="mytime" /><!-- 如不需要在前臺(tái)顯示的話可以修改type="hidden" --> <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> <input type="hidden" name="dede_fields" value="mytime,textchar" /> <input type="hidden" name="dede_fieldshash" value="849a871768b5942ee259e8f7af736194" /> <label><input class="btn_tj" type="submit" name="Submit" value=" 提交" /></label> </form> |
版權(quán)聲明: 本站資源均來(lái)自互聯(lián)網(wǎng)或會(huì)員發(fā)布,如果侵犯了您的權(quán)益請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)刪除!謝謝!
轉(zhuǎn)載請(qǐng)注明: 為織夢(mèng)模板下載dede源碼自定義表單添加提交時(shí)間的方法