I have this requirement to write an undo function in Javascript, just looking 
for ideas on how to approach this, sorry for the off topic but this is a cool 
list.

There will be a mult-select box pre-populated with some elements from the 
database.
The user can modify the pre-populated elements
There will be the option to add a new element to the multi-select box.
There will be an undo button.

Now when the user clicks undo the last action should undo the last action.
If the last action was to add a new element then that element should be removed 
from the list.
If the last action was to modify an element then the modification should be 
undone.

The only thing I can think of is an array of function calls, so when a user 
adds a new element, for instance, a function removeElement(newElementID) is put 
into an array.  Then when the user clicks undo the function in the array 
element is run and then removed from the array.

Any other ideas or suggestions on my idea?  Again sorry for somewhat of topic. 
Just looking for ideas really.

Cheers
Martin

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion

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

Reply via email to