View Full Version : Date Question

01-26-2003, 11:20 PM
I am sure this is easy for some, I just do not understand.

Date Question -
Is there a way of displaying a date automatically in a field? I have declared it it just does not show up. I can enter a date and it saves, I just want to do it automatically - dynamic.

Thank you in advance.

The Wizzard
01-26-2003, 11:23 PM
<input type="text" name="InsertDate" value="<%= FormatDateTime(Date) %>">

01-26-2003, 11:39 PM
Question #2
Thank you for the code example. To explain a little further:
I have a inventory database and when the data entry people enter the inventory and hit submit, I want the date to automatically go in the field for that entry. Not to automatically be updated by the actual real date everyday those recprds are opened. I am sorry for the confusion.

The Wizzard
01-26-2003, 11:48 PM
Create a field called "Date" or whatever you want, and then have two seprate forms, one to "Add" new inventory, and one to "Update" current inventory.

Then, when you go to Update inventory, use this...

<input type="text" name="Date" value="<% = rsTbl("Date") %>">

01-27-2003, 12:13 AM
I created a field called Date for the update and edit. My only problem with the above code the date stays blank. I did the below code and it is still blank:

Dim Date
If Date = "" then
Date = request("Date")
End If
<input type="text" name="Date" value="<% = Server.HTMLEncode(rs("Date")) %>"><br>

I thought this would work. Am I missing something?? Thank you again for your previous help.

The Wizzard
01-27-2003, 12:20 AM
This tutorial should help you out...