Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hidden Date Field Issue Not Updating Properly

Status
Not open for further replies.

Luvsql

Technical User
Apr 3, 2003
1,179
CA
I have a form that emails me and updates a SQL database. ALL fields work except I cannot get the hidden field for a date to work. In the Value area Dreamweaver I have <%=Date()%> (this is the value I typed into the white box area). After I click Submit, my database field value for that field is "<%=Date()%>" and not the actual date and the email I receive is showing the Field Name but blank as the value. The form is an ASP page. Why is this so hard to get working? I don't have any other issue with any other field, including all my other hidden fields.
 
There is no write command. I am assuming you missed something like this.

Code:
<%
response.write("Hello World!")
%>

but this is all conjecture. seeing the actual code is much more helpful.

Darryn Cooke
| Marketing and Creative Services
 
All my other hidden fields work and show in my emails and databases. I know that there is no write command. I'm using HotDreamweaver's ASP To Database's code to do that.

This field works (along with 8 other hidden ones just like it)

<input name="Location" type="hidden" id="Location" value="TORONTO" />

This one does not:

<input name="Date" type="hidden" id="Date" value="<%=Date()%>"/>

My email for Date is blank and the database shows "<%=Date()%>" as the value. No dates.

I don't have issues with the form or sending form data. I only have an issue capturing a date.


 
So you are trying to write in today's date?

I don't know much about ASP but there is no write command there. Assuming your page is an ASP page your server will parse whats between the %'s to just be garbage unless there is a previous function that stipulates that "=Date()" SHOULD be something. You need something like this

Code:
<%response.write(date())%>

this will write the date (you can change the formatting of the date with se the examples here
As far as your script is concerned the value for date IS "<%=Date()%>". You have not given ASP any command to run. It works like this for all scripting languages (front or back end) you have to specify what you want the output to be.

Darryn Cooke
| Marketing and Creative Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top