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

Patch multi dimensional array fields #69

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

goldsky
Copy link

@goldsky goldsky commented Jun 9, 2012

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.

@goldsky
Copy link
Author

goldsky commented Jun 9, 2012


<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;

@goldsky goldsky closed this Jun 9, 2012
@goldsky goldsky reopened this Jun 9, 2012
@jpdevries
Copy link
Collaborator

I'm having a hard time understanding the use case for this one

@goldsky
Copy link
Author

goldsky commented Feb 5, 2014

I'll make a demo

@goldsky
Copy link
Author

goldsky commented Feb 5, 2014

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

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

Successfully merging this pull request may close these issues.

2 participants