Skip to content

Instantly share code, notes, and snippets.

@j
Created June 23, 2011 23:15
Show Gist options
  • Save j/1043869 to your computer and use it in GitHub Desktop.
Save j/1043869 to your computer and use it in GitHub Desktop.
<div class="form-box">
<h2>Creative Panel for {{ offer.getName }}</h2>
<form {% if edit == true %}class="dontHide"{% endif %} style="display: block;" action="{{ postUrl }}" method="post" novalidate="novalidate">
{{ form_errors(form) }}
{{ form_row(form.name) }}
{{ form_row(form.title) }}
{{ form_row(form.description) }}
{{ form_row(form.body) }}
{{ form_row(form.script) }}
<div>
<label>Questions</label>
<div id="creativeQuestions">
{% for question in form.creativeQuestions %}
{{ form_widget(question.question) }}
{{ form_widget(question.pos) }}
{% endfor %}
<div><a href="#">Add</a></div>
</div>
</div>
{{ form_rest(form) }}
<div class="buttons">
<input type="submit" value="Save" />
<input type="reset" value="Cancel" />
</div>
<br class="clear" />
</form>
</div>
## this way outputs the $$name$$ field as a real form element
<div class="form-box">
<h2>Creative Panel for {{ offer.getName }}</h2>
<form {% if edit == true %}class="dontHide"{% endif %} style="display: block;" action="{{ postUrl }}" method="post" novalidate="novalidate">
{{ form_errors(form) }}
{{ form_rest(form) }}
<div class="buttons">
<input type="submit" value="Save" />
<input type="reset" value="Cancel" />
</div>
<br class="clear" />
</form>
</div>
## this way outputs the $$name$$ field correctly inside a <script type="text/html></script> box so the form doesn't catch it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment