andrew.daniels
New Member
Okay guys. Need some help here. I want to load the current date into the inital value of a text field using javascript any help here? where have I gone wrong.
First time using javascript so I'm pretty nooby - normally I'd just write Today and leave it at that, I've used w3schools and a few other tutorials to get to this stage.
<tr>
<td><label>Preferred Commencement Date:</label>
<script type="text/javascript">var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
var year = currentTime.getFullYear()
var date = (month + "/" + day + "/" + year)
</script>
</td>
<td><label>
<input name="date" type="text" id="date" onLoad="document.getElementById(date)" />
</label></td>
</tr>
First time using javascript so I'm pretty nooby - normally I'd just write Today and leave it at that, I've used w3schools and a few other tutorials to get to this stage.