Prevent Partial Update via Client Side Javascript - Did You Know?
Sunday, August 30, 2009 at 5:06PM You can cancel the partial submission (and subsequent server-side event execution) by having the associated client side event "return false".
For example, if you have a server action that deletes a document, you can attach a client side script to confirm the action in the same event, before the submission occurs, and cancel the partial submission. In the Event property page, select the "client" tab for the same event you have the server-side code, and enter code similar to:
if (!confirm("Are you sure you want to delete this document?")) { return false; };
/* More code could go here, and would get executed if the user clicks "Ok" */
This will prevent any code after the confirm from running if the user clicks "Cancel", including the submission of the partial update.
For example, you could fade out the document using dojo.fadeOut() before sending the partial update to the server, adding a bit of flair to your application (and everybody wants to have more than just the minimum required pieces of flair, right?).
Illus. 1 - Server Side Script that runs "onClick"
Illus. 2 - Client Side Script - First Line does a confirm, like the code above
Happy Coding!
Code Snippets in
Tips and Tricks 
