<!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> </DIV>
<DIV><FONT face=Arial size=2>Here a tiny example of my current
aproach:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> $form['criteria'] =
array(<BR> '#type' => 'fieldset',<BR> '#title' =>
t('Criterias'),<BR> '#collapsible' =>
TRUE,<BR> '#collapsed' => FALSE,<BR> '#tree' =>
TRUE,<BR> );<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>for ($i=1; $i<=variable_get('beginer_criteria',
3); $i++) {<BR></FONT><FONT face=Arial
size=2> $form['criteria'][$i]['table[]'] =
array(<BR> '#type' =>
'select',<BR> '#options' =>
$tables,<BR> '#value' =>
$load[$i]['table'],<BR> '#description' =>
$load[$i]['table'],<BR> '#attributes' =>
array(<BR> 'class' =>
'edit-table',<BR> ),<BR> );<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> </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> </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> </DIV>
<DIV><FONT face=Arial size=2>my HTML is:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><PRE id=line234><FONT face=Arial size=2><<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>qz-tablefield</SPAN>><<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>"form-item"</SPAN>>
<<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>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"0"</SPAN>>Select an option</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"6"</SPAN>>criticality</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"2"</SPAN>>group</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"4"</SPAN>>origin</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"3"</SPAN>>position</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"5"</SPAN>>priority</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"1"</SPAN>>reason</<SPAN class=end-tag>option</SPAN>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"7"</SPAN>>status</<SPAN class=end-tag>option</SPAN>></<SPAN class=end-tag>select</SPAN>>
</<SPAN class=end-tag>div</SPAN>>
<<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>"form-item"</SPAN>>
<<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>><<SPAN class=start-tag>option</SPAN><SPAN class=attribute-name> value</SPAN>=<SPAN class=attribute-value>"0"</SPAN>>Select a table</<SPAN class=end-tag>option</SPAN>></<SPAN class=end-tag>select</SPAN>>
</FONT></PRE><PRE id=line240><FONT face=Arial size=2></<SPAN class=end-tag>div</SPAN>>
<<SPAN class=start-tag>div</SPAN><SPAN class=attribute-name> class</SPAN>=<SPAN class=attribute-value>"form-item"</SPAN>>
<<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>>
</<SPAN class=end-tag>div</SPAN>></FONT></PRE><PRE><FONT face=Arial size=2></FONT> </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> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks a lot</FONT></DIV>
<DIV><FONT face=Arial size=2>Feijó</FONT></DIV></BODY></HTML>