Dear all, I have created a function to display today's date in mm/dd/yyyy format and now I wish to display it in the form as soon as the user enters, so by default, if he does not want to change it, there is always today's date displayed.
The function is as follows:-
function getTodaysDate() {
var today = new Date()
var todayDate = today.getDate()
var todayMonth = today.getMonth() + 1
var todayYear = today.getYear()
if (todayMonth < 10)
{
todayMonth = ( "0" + todayMonth)
}
var fulldate = ( todayMonth + "/" + todayDate + "/" + todayYear )
return fulldate
}
Now I wish to display it in the form, ie:-
<input type="text" name="insertDate" value="????" size="13" maxlength="10"
How can I put the function in the value field?
Thanks for your help
The function is as follows:-
function getTodaysDate() {
var today = new Date()
var todayDate = today.getDate()
var todayMonth = today.getMonth() + 1
var todayYear = today.getYear()
if (todayMonth < 10)
{
todayMonth = ( "0" + todayMonth)
}
var fulldate = ( todayMonth + "/" + todayDate + "/" + todayYear )
return fulldate
}
Now I wish to display it in the form, ie:-
<input type="text" name="insertDate" value="????" size="13" maxlength="10"
How can I put the function in the value field?
Thanks for your help