Created
December 3, 2012 19:58
-
-
Save biilmann/4197563 to your computer and use it in GitHub Desktop.
Using an extension to split a textarea into lines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<pop:content> | |
<select name="sizes"> | |
<pop:utils:split field="sizes"> | |
<option><pop:value/></option> | |
</pop:utils:split> | |
</select> | |
</pop:content> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.split = function(options, enclosed, scope) { | |
var val = scope.lookup(options.field); | |
if (val) { return val.split("\n"); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment