You have just spent the last hour writing a blog post. It is a devasting rebuttal of every argument that your blogospheric archnemsis has devised. You know that everyone who reads it will be in awe of your logic, your persuasive power, and your grasp of grammar. The mental image of he_who_should_not_be_named crying at his utter defeat fills you with a deep sense of satisfaction.
You click the submit button and scream in horror as you see the error message about the missing title. There staring you in the face is a blank text box where your masterpiece was supposed to be. The back button brings you no satisfaction.
Sticky forms help to prevent the above situation. Instead of returning you to a blank form when an error occurs, the text you submitted is redisplayed in the form (that's why it is called sticky). Elgg's blog plugin has had auto-saving of drafts for a while now. But there were many forms that were not sticky in Elgg 1.7 and those that were used custom code to accomplish this.
Elgg 1.8 adds an API for making forms sticky. It works like this:
For examples on how these functions are being used in Elgg, check the useradd form/action or the bookmarks plugin's save form/action along with its bookmarks_prepare_form_vars() function.
Help prevent web form submission rage by making your forms sticky!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.