You can also double post the fields with original data.
form.lastname_orriginal, form.lastname_new, then compare the values on your
action page.  This could then serve as the comparison operator for your
javascript coloring.  If the 2 values don't match, change background to red,
if the user changes it back it goes green again, etc.

The other option is to have your color function update a list that you store
in a hidden form element.  This list contains the fieldnames that have
changed, then just loop over the list and update as needed.  I don't like
this as its extremely JS dependent, and your app breaks if JS is disabled.

I'm not a big fan of this either sollution, but it accomplishes what your
looking to do.  Unless your updates span many tables, I don't feel your
saving much database time by only updating 3 fields vs 30 fields, and your
adding some effort in pre-processing now.   I've not tested, but I bet the
pre-processing in CF is more expensive than the additional fields in the
insert.  However, as I said before, the number of tables your updating would
impact this significantly.

Trey Rouse

On 9/25/06, Teddy Payne <[EMAIL PROTECTED]> wrote:
>
> The red and green aspect would probably be faciliated by client side
> scripting like Javascript to change the colors of the data fields as they
> are modified.  OnChange event should handle those just fine.
>
> Are you opposed to querying the database for a complete recordset?  What I
> mean by this, you can load the record in action page and then compare
> against the variables in the form scope.  Once you compare the fields that
> have changes, you can create a structure to store the names of the column
> and the data to be updated.  After you create the structure, loop over the
> structure inside of cfquery statement with the column names in insert into
> tableName () area and the values in the values() area.
>
> Does that make sense?
>
> Teddy
>
> On 9/25/06, Richard White <[EMAIL PROTECTED]> wrote:
> >
> > Hi, i am used to programming standalone computer applications not
> internet
> > applications and would really appreciate some advice.
> >
> > I have a form with quite a few fields (text boxes etc...) on it. For
> > additiional HCI, when the user edits the form from pre-exsting data, i
> like
> > to have the fields all green, then if they edit some of the fields they
> turn
> > red, to show that the changed data needs to be saved.
> >
> > To lesson the load on the database interation, i would like to program
> it
> > so that when the user clicks save changes, it only updates the database
> > based on the fields that are red. This is quite simple in standalone
> > computer apps as i just code it to look for the fields that are red, but
> of
> > course with the internet apps i cant check this as when the user clicks
> > submit the fields are gone.
> >
> > Can anyone give me some advice on how this can be done. I am a bit lost
> > with this. Thanks
> >
> >
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254096
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to