Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Ability to set options to tweak each value #2

Open
matryer opened this issue Jul 19, 2013 · 3 comments
Open

Feature Request: Ability to set options to tweak each value #2

matryer opened this issue Jul 19, 2013 · 3 comments

Comments

@matryer
Copy link

matryer commented Jul 19, 2013

I'd like to be able to set a function option that lets me modify each value as it's coming in, or going out:

$("form").formaize({
  toData: function(value, options){ return parseInt(value)+1; },
  toForm: function(value, options){ return value-1; }
});
  • Not sure about names
@matryer
Copy link
Author

matryer commented Jul 19, 2013

after - function to call when the job is done.
before - function to call before the job starts
fromNumber - overrides for $.formalize.fn.fromNumber just for this use
skip - list of fields to ignore (deep nested if you like)
pick - function to decide whether a field gets included or not
skipels - jQuery selector of elements to skip (i.e. skipels:".secret")
set - function to set the value in the object to allow people to customise how the object gets built.

NOTE: skipels is a shit name

@mazondo
Copy link
Owner

mazondo commented Jul 19, 2013

Wouldn't this be handled by #3 ?

@matryer
Copy link
Author

matryer commented Jul 19, 2013

(see my other comments for other option ideas)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants