I want to create a form using an unordered list ul must have only two levels which I am not getting in this demo:
http://jsfiddle.net/rathoreahsan/9SCCn/
When I add a sub-list it adds one sub list of parent list (it is fine) but when I add another sub-list it adds a sub-list for newly added sub-list (that i don’t want). I want when I add sub-list it only add 1 sub-list of a parent list instead of adding sub-list of newly added sub-lists.
Current Structure:
<ul>
<li><input type="text" />
<ul>
<li><input type="text" /></li> // New added sub list
<ul> //It should'nt be like this when added more
<li><input type="text" /></li>
</ul>
</li>
</ul>
</li>
</ul>
The structure should be like this:
<ul>
<li><input type="text" />
<ul>
<li><input type="text" /></li> // New added sub list
<li><input type="text" /></li> //It should be like this when added more
</ul>
</li>
</ul>
Edited
Finally got the solution See Workin Demo: http://jsfiddle.net/rathoreahsan/2hwLp/
JQUERY
HTML:
DEMO:
http://jsfiddle.net/rathoreahsan/2hwLp/