formalizedata icon indicating copy to clipboard operation
formalizedata copied to clipboard

Feature Request: Ability to set options to tweak each value

Open matryer opened this issue 12 years ago • 3 comments

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 avatar Jul 19 '13 01:07 matryer

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

matryer avatar Jul 19 '13 01:07 matryer

Wouldn't this be handled by #3 ?

mazondo avatar Jul 19 '13 02:07 mazondo

(see my other comments for other option ideas)

matryer avatar Jul 19 '13 14:07 matryer