Brought to you by KitGUI :: The Cloud CMS for Dynamic Websites Cloud CMS
HTML5 Powered with Offline & Storage

dumbFormState.js

This jQuery html 5 plugin automatically saves and persists form state on the client-side across page requests without need of server-side state management or cookies. ALL the major browsers support this!
code snippit <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.min.js"></script> <script src="http://s3.amazonaws.com/jasonsebring/js/json2.js"></script> <script src="http://s3.amazonaws.com/jasonsebring/js/dumbFormState-1.js"></script> <script> jQuery(function(){ // ensure dom is loaded first jQuery('form').dumbFormState(); }); </script> Its best to save your own files locally as the file hosting is subject to change without notice. features * keeps the state of form entries in browser session or across sessions without cookies * able to choose form entries not to persist * works across multiple forms and pages * automatically persists form data without submit * can remove persisted data in a form, a session, local or all * plays nicely with your form events * fails gracefully on unsupported devices dependancies: * HTML 5 storage capability
Safari 4+, Opera 2.7+, IE 8+, Firefox 3.5+, Chrome 4+ * jQuery 1.5 : tested only in latest version -> jQuery.com * json2.js : Douglas Crockford GitHUB -> https://github.com/douglascrockford/JSON-js configurable options: jQuery('form').dumbFormState({ persistPasswords : false, // default is false, recommended to NOT save people's passwords persistLocal : false, // default is false, setting to false will enable sessionStorage, setting true will span across sessions skipSelector : null, // takes jQuery selector of form entry items you DO NOT want to persist such as '#password,#creditcard,#cvv2' autoPersist : true // default is true, if false will only persist on form submit }); instance methods: jQuery('form').dumbFormState('remove'); // removes data and events associated with forms matching the selector static methods: jQuery.fn.dumbFormState.removeSession(); // clears all session data relating to dumbFormState jQuery.fn.dumbFormState.removeLocal(); // clears all local data relating to dumbFormState (across sessions) jQuery.fn.dumbFormState.removeAll(); // clears all data relating to dumbFormState special note: This only persists form elements that have a "name" attribute. Take care to clean up the data after the user does not need it. demo: multiple <form> tags shown below with the same names, persists for browser session, does NOT store passwords by default. The form looks odd in IE9 due to IE9's inability to style markup to standard, however it the script functions as designed in IE9.


a b c
x y z




a b c
x y z




a b c
x y z


This page demonstrates offline storage capabilities for HTML 5 persisting form data on the client-side. The potential of HTML 5 is a game changer. Imagine all the server-side code written to maintain postbacks and form state in general which is not needed anymore.
Contact for bugs, etc.
jQuery的插件,以维持HTML5的形式选择和跨页请求表单状态
jQueryのHTML5は、ページ要求にまたがってフォームを選択し、フォームの状態を維持するプラグイン
jQuery의 HTML5 페이지에 걸쳐 요청 양식 선택 및 양식 상태를 유지하기 위해 플러그인
jQuery-Plugin, um HTML5 Form Selektionen und Form staatlicher Seite über Zugriffe pflegen
HTML5 plugin de jQuery para mantener selecciones de forma y estado de forma en las solicitudes de página
JQuery HTML5 плагин для поддержания формы и формы выбора состояния между запросами страниц
jQuery HTML5 plugin för att bibehålla formen val och form stat över sidförfrågningar
HTML5 jQuery plugin כדי לשמור על בחירות הטופס המדינה הטופס ברחבי בקשות הדף
HTML5 jQuery plugin để duy trì các lựa chọn hình thức và hình thức nhà nước yêu cầu trên trang
HTML5 jQuery plugin untuk mempertahankan pilihan bentuk dan bentuk negara di seluruh permintaan halaman
HTML5 مسج المساعد للحفاظ على شكل اختيارات الدولة وشكل عبر طلبات الصفحة
HTML5 jQuery plug-in pentru a menţine forma şi selecţii de stat în formă cereri de start
jQuery HTML5 plugin for å opprettholde formen valg og danne statlige tvers sideforespørsler