You are here: irt.org | FAQ | JavaScript | Date | Q1635 [ previous next ]
Try:
<html>
<head>
<script language="JavaScript"><!--
function makeDate() {
now = new Date();
return now.getYear() + '/' + (now.getMonth()+1) + now.getDate();
}
//--></script>
</head>
<body onLoad="document.myForm.myField.value = makeDate()">
<form name="myForm">
<input type="text" name="myField" value="">
</form>
</body>
</html>