Hmm i made a small change and it works now
Find:
// Ajout des ingrédients
$nbingredientF = new XoopsFormHidden('nbingredient', $nbingredient);
$sform->addElement($nbingredientF);
for ( $ii=0;$ii<$nbingredient;$ii++ )
{
$jj=$ii+1;
${'ligne'.$ii} = new XoopsFormElementTray(_NW_INGREDIENT);
if ( $ii+1>count($quantite) )
{
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_QT, 'qt'.$jj, 10, 40, ''), true);
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_INGREDIENT, 'ing'.$jj, 20, 50, ''), true);
}
else
{
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_QT, 'qt'.$jj, 10, 40, $quantite[$ii]), true);
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_INGREDIENT, 'ing'.$jj, 20, 50, $ingredient[$ii]), true);
}
$add_btn = new XoopsFormButton('', 'addIng', _NW_AJOUT_ING, 'submit');
$add_btn->setExtra('accesskey="a"');
${'ligne'.$ii}->addElement($add_btn);
$sform->addElement(${'ligne'.$ii});
}
Replace:
// Ajout des ingrédients
$nbingredientF = new XoopsFormHidden('nbingredient', $nbingredient);
$sform->addElement($nbingredientF);
for ( $ii=0;$ii<$nbingredient;$ii++ )
{
$jj=$ii+1;
${'ligne'.$ii} = new XoopsFormElementTray(_NW_INGREDIENT);
if ( $ii+1>count($quantite) )
{
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_QT, 'qt'.$jj, 10, 40, ''), false);
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_INGREDIENT, 'ing'.$jj, 20, 50, ''), false);
}
else
{
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_QT, 'qt'.$jj, 10, 40, $quantite[$ii]), false);
${'ligne'.$ii}->addElement(new XoopsFormText(_NW_INGREDIENT, 'ing'.$jj, 20, 50, $ingredient[$ii]), false);
}
$add_btn = new XoopsFormButton('', 'addIng', _NW_AJOUT_ING, 'submit');
$add_btn->setExtra('accesskey="a"');
${'ligne'.$ii}->addElement($add_btn);
$sform->addElement(${'ligne'.$ii});
}