<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.3243" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I'm building a dynamic filter system, my user will 
be able to add as much criteria he wants</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Here a tiny example of my current 
aproach:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;$form['criteria'] = 
array(<BR>&nbsp;&nbsp;'#type' =&gt; 'fieldset',<BR>&nbsp;&nbsp;'#title' =&gt; 
t('Criterias'),<BR>&nbsp;&nbsp;'#collapsible' =&gt; 
TRUE,<BR>&nbsp;&nbsp;'#collapsed' =&gt; FALSE,<BR>&nbsp;&nbsp;'#tree' =&gt; 
TRUE,<BR>&nbsp;);<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>for ($i=1; $i&lt;=variable_get('beginer_criteria', 
3); $i++) {<BR></FONT><FONT face=Arial 
size=2>&nbsp;&nbsp;$form['criteria'][$i]['table[]'] = 
array(<BR>&nbsp;&nbsp;&nbsp;'#type' =&gt; 
'select',<BR>&nbsp;&nbsp;&nbsp;'#options' =&gt; 
$tables,<BR>&nbsp;&nbsp;&nbsp;'#value' =&gt; 
$load[$i]['table'],<BR>&nbsp;&nbsp;&nbsp;'#description'&nbsp;&nbsp; =&gt; 
$load[$i]['table'],<BR>&nbsp;&nbsp;&nbsp;'#attributes' =&gt; 
array(<BR>&nbsp;&nbsp;&nbsp;&nbsp;'class' =&gt; 
'edit-table',<BR>&nbsp;&nbsp;&nbsp;),<BR>&nbsp;&nbsp;);<BR>}</FONT></DIV>
<DIV><BR><FONT face=Arial size=2>The form will start with X sets of fields (2 
combo, 1 editfield)</FONT></DIV>
<DIV><FONT face=Arial size=2>I set jQuery to clone any of those criteria, adding 
more</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Here the problem begin, any cloned, will have the 
same name of the original one.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>My $form_values does not return the cloned 
fields.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>my HTML is:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><PRE id=line234><FONT face=Arial size=2>&lt;<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>qz-tablefield</SPAN>&gt;&lt;<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>"form-item"</SPAN>&gt;
 &lt;<SPAN class=start-tag>select</SPAN><SPAN class=attribute-name> name</SPAN>=<SPAN class=attribute-value>"criteria[1][table[]]" </SPAN><SPAN class=attribute-name>class</SPAN>=<SPAN class=attribute-value>"form-select edit-table" </SPAN><SPAN class=attribute-name>id</SPAN>=<SPAN class=attribute-value>"edit-criteria-1-table[]" </SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"0"</SPAN>&gt;Select an option&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"6"</SPAN>&gt;criticality&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"2"</SPAN>&gt;group&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"4"</SPAN>&gt;origin&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"3"</SPAN>&gt;position&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"5"</SPAN>&gt;priority&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"1"</SPAN>&gt;reason&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"7"</SPAN>&gt;status&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;/<SPAN class=end-tag>select</SPAN>&gt;
&lt;/<SPAN class=end-tag>div</SPAN>&gt;
&lt;<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>"form-item"</SPAN>&gt;
 &lt;<SPAN class=start-tag>select</SPAN><SPAN class=attribute-name> name</SPAN>=<SPAN class=attribute-value>"criteria[1][field[]]" </SPAN><SPAN class=attribute-name>class</SPAN>=<SPAN class=attribute-value>"form-select edit-field" </SPAN><SPAN class=attribute-name>id</SPAN>=<SPAN class=attribute-value>"edit-field1" </SPAN><SPAN class=attribute-name>id</SPAN>=<SPAN class=attribute-value>"edit-criteria-1-field[]" </SPAN>&gt;&lt;<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"0"</SPAN>&gt;Select a table&lt;/<SPAN class=end-tag>option</SPAN>&gt;&lt;/<SPAN class=end-tag>select</SPAN>&gt;
</FONT></PRE><PRE id=line240><FONT face=Arial size=2>&lt;/<SPAN class=end-tag>div</SPAN>&gt;
&lt;<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>"form-item"</SPAN>&gt;
 &lt;<SPAN class=start-tag>input</SPAN><SPAN class=attribute-name> type</SPAN>=<SPAN class=attribute-value>"text" </SPAN><SPAN class=attribute-name>maxlength</SPAN>=<SPAN class=attribute-value>"100" </SPAN><SPAN class=attribute-name>name</SPAN>=<SPAN class=attribute-value>"criteria[1][value[]]" </SPAN><SPAN class=attribute-name>id</SPAN>=<SPAN class=attribute-value>"edit-criteria-1-value[]"  </SPAN><SPAN class=attribute-name>size</SPAN>=<SPAN class=attribute-value>"30" </SPAN><SPAN class=attribute-name>value</SPAN>=<SPAN class=attribute-value>"" </SPAN><SPAN class=attribute-name>class</SPAN>=<SPAN class=attribute-value>"form-text" </SPAN><SPAN class=error><SPAN class=attribute-name>/</SPAN></SPAN>&gt;
&lt;/<SPAN class=end-tag>div</SPAN>&gt;</FONT></PRE><PRE><FONT face=Arial size=2></FONT>&nbsp;</PRE><PRE><FONT face=Arial size=2>Note the criteria[1], the next set will be criteria[2]</FONT></PRE><PRE>The cloned criteria will to be 1 ! the $form_values ignore the new fields.</PRE></DIV>
<DIV><FONT face=Arial size=2>What can I change in my $form to solve 
that?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks a lot</FONT></DIV>
<DIV><FONT face=Arial size=2>Feijó</FONT></DIV></BODY></HTML>