Question

My code is here: http://jsfiddle.net/spadez/LRFMQ/14/

I tried to add two select fields to each line when hitting the add question button, so the added questions have the same fields as the initial one.

This is the problem bit of the code:

<select>
    <option value="single">Single line reply</option>
    <option value="multi">Paragraph reply</option>
</select>
<select>
    <option value="single">Required</option>
    <option value="multi">Optional</option>
</select>

It doesnt seem to like the way I have added my html form code into the javascript. Do I need to escape it somehow?

Was it helpful?

Solution

Use a hidden div for structure and .clone it for adding.

$("div.toClone").clone().removeClass("toClone").insertBefore(InputsWrapper);

FIDDLE

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top