Created
August 1, 2011 20:29
-
-
Save j/1118915 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$('div.collection div.add a').click(function() { | |
var $parent = $(this).parent().parent(), $prototype = $parent.find('div:first div:last'), html; | |
html = $prototype.attr('data-prototype').replace(/\$\$name\$\$/g, $parent.find('div:first > div:not(:last)').length); | |
$prototype.before(html); | |
return false; | |
}); |
This file contains hidden or 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
<div class="collection"> | |
{{ form_row(form.parameters) }} | |
<div class="add"> | |
<a style="float: right;" href="#" title="Add">Add</a> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment