Pergunta

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?

Foi útil?

Solução

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

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

FIDDLE

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top