diff --git a/README.md b/README.md index fa8541e..8f0ddea 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,27 @@ Supports **json** (default) and **urlencoded** (x-www-form-urlencoded). **Note!** Response has to be **json**. +#### mapping +```javascript +var MyForm = React.createClass({ + mapInputs: function (inputs) { + return { + 'field1': inputs.foo, + 'field2': inputs.bar + }; + }, + render: function () { + return ( + + + + + ); + } +}) +``` +Use mapping to change the data structure of your input elements. This structure is passed to the onSubmit handler and/or to the server on submitting, depending on how you submit the form. + #### onSuccess(serverResponse) ```html