HighDots Forums  

Automatic value on an update page

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Automatic value on an update page in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
TomHuffman
 
Posts: n/a

Default Automatic value on an update page - 03-27-2009 , 02:43 PM






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?


Reply With Quote
  #2  
Old   
TomHuffman
 
Posts: n/a

Default Re: Automatic value on an update page - 03-27-2009 , 04:11 PM






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!


Reply With Quote
  #3  
Old   
Baxter
 
Posts: n/a

Default Re: Automatic value on an update page - 03-27-2009 , 04:36 PM



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

"TomHuffman" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
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?




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.