No replies
urwen's picture
Offline
Joined: 01/09/2008
Juice: 20
Was this information Helpful?

Hi all,

i need to add the possibility to my users to add more fields of a form included in ubercart, concretly:

$form['base']['dimensions']

That's it, the user must be able to add a dimension, but after finishing i need to give him the possibility to add another field with the classical button "add more" wich the other fields have when you select "unlimited".

By the moment i've done a very simple module, customizing the module for me, but i dont know how to continue or where to read more information about it.

Any help please?? Thanks a lot in advance

ThatÅ› the code:

<?php
// $Id$

/**
* @file
* Module to hold my customizations to Ubercart
*/

/**
* Implementation of hook_form_alter()
*/
function mymod_form_alter(&$form, $form_state, $form_id) {

  if ($form_id == 'product_node_form') {

//eliminamos el product information entero
// $form['base'] = array();

//$form['base']['dimensions'] = array();    // THIS IS THE FIELD WHICH I'D NEED TO "ADD MORE" BY THE USER

$form['base']['model'] = array();
$form['base']['weight'] = array();
$form['base']['weight']['weight_units'] = array();

}