Automatic value on an update page

Automatic value on an update page

Post by TomHuffma » Sun, 29 Mar 2009 03:43:06


Ordinarily, an update record page will pull the existing data from the
database, display it, allow you to manually edit it, and then update the value.

What I would like to do is define the update form field in such a way that it
is automatically updated to a specific value that does not require user
intervention.

For example, for the field "STATUS" Dreamweaver inserts the following code
into the initial value property for the corresponding form element on the
update page.

<%=(MyData.Fields.Item("STATUS").Value)%>

This just displays the current value in that field, which I can change if I
like. I want to edit this code so that it will automatically update this field
with a specified string, let's say "Checked out". If I simply add the desired
string at the end, it just appends it to the existing record rather than
updating it. I'm sure this is something simple, but I'm just not seeing it.

On a related note, how do I add today's date to a "Date Updated" field on an
update page? I know how to insert a record with today's date

<%= fmtDateTime(Now(), "yyyy-mm-dd hh:mm:ss")%>

but how do a I update a previously empty field "Date Updated" field with
today's date whenever that record is updated?
 
 
 

Automatic value on an update page

Post by TomHuffma » Sun, 29 Mar 2009 05:11:18

OK, I was just being dumb about this. The code that DW inserts in the initial
value field simply tells the app to display the value already in the database
by default. If you just delete all of this, you can insert any default value
you wish. Duh!

 
 
 

Automatic value on an update page

Post by Baxte » Sun, 29 Mar 2009 05:36:57

On the "On a related note, how do I add today's date to a "Date Updated"
field on an
update page?"
Did you sort this? If not make the Date_Updated field in the database a
Date/Time field with a Format of Long Date and the default-value Now()
That will insert the correct date and time of the update.
Dave



value.
that it
code
I
field
desired
it.
an