simsalabim/sisyphus

Class based fields & persist after submit.

regiside opened this issue · 1 comments

Can't really find any documentation for this plugin, not sure if it used to be on http://sisyphus-js.herokuapp.com/ but there's nothing there now.

I'm wanting to save only form fields with a specific class into storage and I'd like them to persist after the form has been submitted as they will be some basic info about the user that will always be the same.

Anyone know if there's a way to do this with sisyphus?

Found the documentation on WayBack Machine. https://web.archive.org/web/20200927100957/http://sisyphus-js.herokuapp.com/

Was able to achieve the desired affect using the "autoRelease" & "excludeFields" parameter combined with the :not() css selector...

jQuery( "form" ).sisyphus( {
		excludeFields: jQuery( "hidden,*:not(.remember *)" ), // Skips hidden fields and any field that's not in a container with the class "remember"
		autoRelease: false, // Stops the fields from being reset upon form submission
	} );