-
Date Format URGENT!
Here is my code:
Sub Window_Onload
on error resume next
Form1.DateBox.value = empty
window.settimeout "Init", 5, vbscript
Form1.DateBox.value = cstr(form1.Dtpicker1.month) & "/" & cstr(form1.dtpicker1.day) & "/" & cstr(form1.dtpicker1.year)
end sub
sub Init
form1.dtpicker1.value = now
end sub
**********************************************
When the page loads up I want to have the value of Datebox = the date appearing on dtpicker1. When the page loads up the following is in the DateBox; 0/0/1
I know that this is because I set the values to a string but how can I get the value on the dtpciker1?
If i go sub Dtpicker1_change
for1.datebox.value = cstr.....
end sub
the value in the box is in a date format
-
Set the values for each component. Set the day to 1 then set the month then the day to what it should be, then the year. If you have the day set to say 30 and you change the month to February, it will throw an error so set it to 1 to be safe.