A little known fact... You can create containers in the forms array that have no visual representation in the form, kind of like fieldsets, but without the fieldset.
While (...) { $form[$id] = array('#tree' => TRUE); $form[$id]['qty'] = array(....); $form[$id]['add'] = array(....); }
Might clean up some of the code you've discovered.
I usually nest all the rows into a single fieldset as well, but that's optional.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Ivan Sergio Borgonovo Sent: Wednesday, March 25, 2009 8:56 AM To: support@drupal.org Subject: Re: [support] multiple buttons with same #value D5
On Wed, 25 Mar 2009 16:32:10 +0100 Ivan Sergio Borgonovo mail@webthatworks.it wrote:
I had to resort to some Web 1.5 techniques
$form['add'][$id]=array( // '#type'=>'button', '#type'=>'submit', '#name'=>$id.'-add', '#value'=>t('Add'), ); }
roll over qty
foreach($form_values['qty']... if($form_values[$key.'-add']==t('Add');
Did things get better in D5+?
-- Ivan Sergio Borgonovo http://www.webthatworks.it
-- [ Drupal support list | http://lists.drupal.org/ ]