»
AnglaisFrançaisVietnamien

Imprimer - JavaScript Auto Date courante de remplissage - JavaScriptBank.com

Version complète: jsB@nk » Form » Textarea » JavaScript Auto Date courante de remplissage
URL: https://www.javascriptbank.com/javascript-current-date-auto-filling.html

JavaScript Auto Date courante de remplissage © JavaScriptBank.comCharger 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



JavaScript
<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>


HTML
<input id="tDate" type="text" readonly="readonly" />