Skip to content

Instantly share code, notes, and snippets.

@farinspace
Created May 27, 2011 04:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save farinspace/994668 to your computer and use it in GitHub Desktop.
Save farinspace/994668 to your computer and use it in GitHub Desktop.
Repeating fields Setup
<div class="container">
<div class="collection">
<div class="template" style="display:none;">
<input type="text" name="questions[%][question]" value="qq"/>
<input type="text" name="questions[%][type]" value="qt"/>
<div class="container">
<div class="collection">
<div class="template" style="display:none;">
<input type="text" name="questions[%][options][@]" value="o"/>
</div>
<!-- some sort of loop to create existing items -->
<div class="item"></div>
</div>
<div><a href="#" class="oadd">Add Option</a></div>
</div>
</div>
<!-- some sort of loop to create existing items -->
<div class="item"></div>
</div>
<div><a href="#" class="qadd">Add Question</a></div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment