Hi.
I have several textboxes, 6 to be precise. What I want is that whenever I click one of them, the current date appears on the box I just clicked.
I have this so far:
function dat() {
var year=document.frm._data1
var currentTime = new Date()
var month = currentTime.getMonth() + 1
var day = currentTime.getDate()
if (day <10) {
day = "0" + day
}
var year = currentTime.getFullYear()
theDate.value = year + "-" + month + "-" + day
}
_data1 refers to the one of the textboxes. How can It works, but for just that box. How can I do this, using "this", besides having to write a function for every single textbox.