> An interval would be set up (say every 5 seconds) that would loop through
> the fields and determine (using the new property) which have changed since
> the last interval (which have been modified by the end user).

And you would want to have this information for, say, analyzing user
interaction
and making design / features changes based on that information?  Would that
be the purpose of such programming?

This wouldn't be for updating page content based on user input, would it?
You're simply looking for any interactivity, not necessarily what
information
is involved in the interactivity, right?

Rick

-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 31, 2005 10:13 AM
To: CF-Talk
Subject: RE: What's wrong with the Javascript?


> -----Original Message-----
> From: Rick Faircloth [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 31, 2005 7:19 AM
> To: CF-Talk
> Subject: RE: What's wrong with the Javascript?
>
> > This capability can be INSANELY useful however.  A great use is in
> adding
> > information to form elements.  You might, for example, add a property
> called
> > "LastUpdate" to all your form elements - you can then set this to the
> > current date/time onChange().
>
> > Another process might run on an interval which loops through the form
> > elements on a page and checks the LastUpdate dates to see which form
> > elements have been changed since the last run through.
>
> Can you expand on this for me?  What do you mean by "to see which form
> elements have been changed since the last run through."  Are you talking
> about the last time the form element itself was changed by the programmer
> or about the last time information was entered?  Don't quite understand...

I was reaching for an example (it was late) but the idea is that you might
have an interface, say a stock watch list or a game, where the end user can
update data in form fields multiple times.

An interval would be set up (say every 5 seconds) that would loop through
the fields and determine (using the new property) which have changed since
the last interval (which have been modified by the end user).

Processing could then be performed on those fields that have changed all at
once.

Of course there are many other ways to do this (you might place all the
changes into a queue to be applied on a schedule for example) but again, I
was reaching for an example.

> And can this info that is generated by JS be used by CF as a variable?
> Stored in a DB or used in a query, etc.?

No directly - but definitely, yes with a little work.

The only form field properties the system normally cares about (and the only
ones that CF would ever see on a POST) are name and value.  However if you
have extra information stored in the JavaScript you can run a process
onSubmit to add that information to hidden form fields or change the value
if the fields.

For example say you have a text area field.  You want to provide an "undo"
feature for it so you add an "EditHistory" property to the textArea object
itself.  Using the onChange event handler you add an entry into this array
every time the user updates the field.

You can then create buttons for the user to "undo" and "redo" by retrieving
the information from the field.  But say you also want to store it
permanently (so that they can "pause" when filling out a form and come back
to it later).

In this case you could use WDDX to covert that Array to a string, place it a
hidden form field and submit it like that.  You could also create a more
concise packet including all of the information about the filed (the name,
value and your editHistory array) and making it the value of the field on
submit.

CF would get the WDDX as a form field value but you could immediately
deserialize and have a usuable struct or Array.

Jim Davis






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:200989
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to