Version compl�te: jsB@nk » Form » Textarea » JavaScript Auto Date courante de remplissage
URL: https://www.javascriptbank.com/javascript-current-date-auto-filling.html
Charger une page web avec cette mise en
Version compl�te: jsB@nk » Form » Textarea » JavaScript Auto Date courante de remplissage
URL: https://www.javascriptbank.com/javascript-current-date-auto-filling.html
<script type="text/javascript">// Created by: Jean P. May, Jr. | http://www.wideopenwest.com/~thebearmay// This script downloaded from www.JavaScriptBank.comfunction autoDate () {var tDay = new Date();var tMonth = tDay.getMonth()+1;var tDate = tDay.getDate();if ( tMonth < 10) tMonth = "0"+tMonth;if ( tDate < 10) tDate = "0"+tDate;document.getElementById("tDate").value = tMonth+"/"+tDate+"/"+tDay.getFullYear(); }// Multiple onload function created by: Simon Willison// http://simonwillison.net/2004/May/26/addLoadEvent/function addLoadEvent(func) { var oldonload = window.onload; if (typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); } }}addLoadEvent(function() { autoDate();});</script>
<input id="tDate" type="text" readonly="readonly" />