<form action="repeater.php"> <div id="SectionContainer"/> <p> <a> <s:event b:on="command"> <s:render b:destination="id('SectionContainer')" b:mode="aslastchild"> <b:formSection index="{count(id('SectionContainer')/*) + 1}"/> </s:render> </s:event> Add section </a> | <a> <s:event b:on="command"> <s:task b:action="remove" b:target="id('SectionContainer')/*[last()]"/> </s:event> Remove last section </a> </p> <p><input type="submit"/></p> </form> <s:htmlstructure b:name="b:formSection"> <fieldset> <legend>Section <s:value-of b:select="{@index}"/></legend> <div> <label>Element 1</label> <input type="text"> <s:attribute b:name="name" b:value="{concat('text',@index)}"/> </input> </div> <div> <label>Element 2</label> <input type="checkbox"> <s:attribute b:name="name" b:value="{concat('checkbox',@index)}"/> </input> </div> </fieldset> </s:htmlstructure>