ScottInTexas
07-16-2004, 06:04 PM
OK, I'm obviously missing something basic about addressing elements on my webpage because I have this problem all the time.
Here is the area of the web page in which the text box resides.
<div id="updateDateDiv">
<input type="text" value="" size="10" id="upDateDate" />
<input type="button" value="Update" onClick="SetUpdateDate()" />
Update Date
</div>
and here is the javascript;
function SetUpdateDate(){
var todaysDate = new Date();
var txtDate = monthName[todaysDate.getMonth()] + " " + todaysDate.getDay() + ", " + todaysDate.getYear();
document.upDateDate.value=txtDate;
}
This generates an error "upDateDate is null or not an object.
Thanks for your help. I know I'll feel stupid when I see the answer.
Here is the area of the web page in which the text box resides.
<div id="updateDateDiv">
<input type="text" value="" size="10" id="upDateDate" />
<input type="button" value="Update" onClick="SetUpdateDate()" />
Update Date
</div>
and here is the javascript;
function SetUpdateDate(){
var todaysDate = new Date();
var txtDate = monthName[todaysDate.getMonth()] + " " + todaysDate.getDay() + ", " + todaysDate.getYear();
document.upDateDate.value=txtDate;
}
This generates an error "upDateDate is null or not an object.
Thanks for your help. I know I'll feel stupid when I see the answer.