i've tried to write a simple piece of code, that puts the current date into a textboxfield.
The current date should be written like this : 20062404
This is what i have so far:
I also tried :
But that didn't work ether. I can't be to far away from a solution, i hope lol.
Who could help me out with this please?
Thanks in advance
The current date should be written like this : 20062404
This is what i have so far:
Code:
<form name="Date">
<input size=20 maxlength=75 type='text' name='TodayDate' value=""></form>
<script language="JavaScript" type="text/javascript">
var date = new Date();
var d = date.getDate();
var day = (d < 10) ? '0' + d : d;
var m = date.getMonth() + 1;
var month = (m < 10) ? '0' + m : m;
var yy = date.getYear();
var year = (yy < 1000) ? yy + 1900 : yy;
document.Date.TodayDate.value.(year + month + day);
</script>
I also tried :
Code:
document.Date.TodayDate.value=(year + month + day);
But that didn't work ether. I can't be to far away from a solution, i hope lol.
Who could help me out with this please?
Thanks in advance