I have the following snippet of code which gives me unterminated string literal error
$(function() {
$(\'#addDropdown\').click(function() {
In general, to use with JavaScript, you should use |escapejs
filter:
var $d = $('{{ value|escapejs }}');
However, as a matter of best practice you'd better put {{ form|bootstrap }}
in HTML, and use JavaScript just to fade in:
<div id="djangoForm" style="display:none">{{ form|bootstrap }}</div>
<script>
$('#addDropdown').click(function() {
$('#dropdownContainer').append($('#djangoForm'));
}
</script>