Skip to content

Protect a form to prompt a user about navigating away from an unsaved form.

License

Notifications You must be signed in to change notification settings

edavis10/form_protector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FormProtector

FormProtector will remind users, via JavaScript, to submit their forms before navigating away from a page.

Example

Include the FormProtector JavaScript by adding javascript_include_form_protector to your layout. Then use protect_form in your view to protect the form.

A plain form with the id of ‘my_form_id’.

<%= protect_form('my_form_id') %>

A form_for form:

<%= protect_form(dom_id(@record, :edit)) %>

Copyright © 2009 Eric Davis, Little Stream Software, released under the MIT license

About

Protect a form to prompt a user about navigating away from an unsaved form.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages