title: Dynamic forms AUI Liferay
body: <p>I am doing a portlet in Liferay with a form like this: </p>
  
  <pre><code>&lt;form method="post" action="&lt;%=actionAddRule.toString() %&gt;" id="myForm" &gt;
      &lt;aui:select  name="attribute" style="float: left;"&gt;
          &lt;c:forEach var="attr" items="${fields}"&gt;
              &lt;aui:option value="${attr}" selected="${condition.attribute==attr}"&gt;${attr}&lt;/aui:option&gt;
          &lt;/c:forEach&gt;                                
      &lt;/aui:select&gt;
      &lt;aui:input type='button' value="Add Condition"  name='addCondition' onClick="addCondition();" %&gt;'&gt;&lt;/aui:input&gt;
      &lt;div id='conditions'&gt;&lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I want that when someone click the button add a new select, but I don't know how do a new . I tried do it with JavaScript with:</p>
  
  <pre><code>var conditions = document.getElementById('conditions');
  conditions.innerHTML('&lt;aui:select ...&gt;...&lt;/aui:select&gt;');
  </code></pre>
  
  <p>and</p>
  
  <pre><code>document.createElement('&lt;aui:select&gt;'); 
  </code></pre>
  
  <p>I tried too with AUI script doing:</p>
  
  <pre><code>var nodeObject = A.one('#divAtr');
  nodeObject.html('&lt;aui:input type="text" name="segment21" label="Segment" value="lalal" /&gt;');
  </code></pre>
  
  <p>But it doesn't work because is html and doesn't can make  AUI, and if I make the new select with HTML normal, when I catch the values some are lost.</p>
  
  <p>Thanks.</p>