FormIt
FormIt copied to clipboard
Patch multi dimensional array fields
with optional to use dynamicFieldTpls property for dynamic HTML form added by javascript. Fallback to implode them with commas to be used by the original Formit's checkboxes snippet.
<script>
var newMob = '[[$mobilephoneDynamicFormChunk:customOutputFilters=`chunkToJsProperty`]]' + "\n";
</script>
chunkToJsProperty:
<?php
$expOptions = @explode(',', $options);
array_walk($expOptions, create_function('&$val', '$val = trim($val);'));
$output = $input;
if (in_array('chunkToJsProperty', $expOptions)) {
$output = str_replace('/', '\/', $output);
$output = str_replace("\n", '', $output);
$output = preg_replace("/(>+(\s)*<+)/", '><', $output);
$output = preg_replace("/\s+/", ' ', $output);
}
return $output;
I'm having a hard time understanding the use case for this one
I'll make a demo
Can this answer your question? http://revo.virtudraft.com/formit-and-dynamic-fields
Actually, I also submitted the pull request on Login.Profile for the same reason. https://github.com/goldsky/Login/commits/develop-extended