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:
|escapejs
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:
{{ form|bootstrap }}