Please note: I have shifted my focus to Python/ Linux/ embedded development and am no longer accepting MODX or PHP projects. For MODX work, I recommend Grey Sky Media.
Features — Introduction and Examples — Documentation
$modx->runSnippet('field',$params_array)
.The field
snippet generates an HTML form field and surrounding HTML, complete with the current value and error placeholders set by FormIt and similar snippets.
See all field parameters.
See all field template placeholders.
[[!fieldSetDefaults? &prefix=`myprefix.` &resetDefaults=`1`]]
[[!field &name=`full_name` &type=`text` &class=`required`]]
[[!field? &name=`email` &req=`1` &tpl=`aDifferentTemplate` &outer_tpl=`ADifferentOuterTpl`]]
[[!field &name=`message` &type=`textarea`]]
[[!field &name=`favorite_color` &type=`checkbox` &options=`Blue||Red||Yellow`]]
[[!field? &type=`radio` &req=`1` &name=`color` &label=`Your Favorite Color:` &default=`` &options=`Red==red||Blue==blue||Other==default`]]
[[!field? &type=`select` &default=`1` &name=`country_id` &label=`Country:` &options_element=`optionsCountries`]]
[[!field? &type=`select` &name=`favorite_things` &multiple=`1` &array=`1` &options=`MODx==modx||Cats and Kittens==felines||World Domination==power`]]
[[!field &name=`submitForm` &type=`submit` &label=` ` &message=`Submit Form`]]
To avoid managing dozens of chunks for each field type, each template chunk contains the template code for all types, delimited by special HTML comments. Use the default templates or make your own by copying them into chunks.
<-- type -->
before and after, where 'type' is the field type.&type
parameter (defaults to 'text').&tpl
parameter.<-- outer_type -->
before and after, where 'outer_type' is the outer field type.&outer_type
parameter (defaults to 'default').&outer_tpl
parameter.fiGenerateReport
snippet is a formIt hook that automatically generates a placeholder of all submitted form fields and values.
For human-readable labels, separate the words in your field names with underscores (which will be converted to spaces in the report).fiProcessArrays
for processing array fields (may not be necessary in newer versions of FormIt).fiProcessArrays,fiGenerateReport
as hooks before the email
hook.[[+figr_values]]
placeholder to output all fields and values detected in the POST.<p><strong>[[+field:replace=`_== `:ucwords]]:</strong> [[+value:nl2br]]</p>
&figrTpl
to change the report row template.
See the official documentation at http://rtfm.modx.com/extras/revo/formitfastpack/
Posted on Jan 09, 2013 by Default Admin User