Hello Community,

I have created a Custom Module by coding that serves the purpose of displaying a form to the user to fill. But additionally I have included 3 Category fields for the form the Content Management >> Categories. Now when this form is shown to users, the category fields are shown as a separate fieldset to the users and only collectively at same order at the top, while I want to show them separately at my specified order and Most importantly I want to show these without fieldset , which is shown as a separate box separate from the whole form. Can someone please tell me how can I do this?

Thanks.

Comments

ainigma32’s picture

Status: Active » Postponed (maintainer needs more info)

Sounds like you need to change the form definition. Can you post what you have sofar?

- Arie

manishaneja’s picture

Hi ainigma32,
Thanks for your reply. Please check below the main structure of my form. I have cut here few input types, that are not making much difference probably, to reduce the length of the form.

function registration_form(&$node) {
  $type = node_get_types('type', $node);
  $sal_oprions = array('' => '', 'Dr.' => 'Dr.', 'Mr.'=> 'Mr.', 'Mrs.' => 'Mrs.', 'Ms.'=> 'Ms.');  
 
  // Set node defaults if empty.
  if (!isset($node->nid) && !isset($node->registration)) {
    $node->nid = 0;
    $additions = registration_load($node);
    $node->registration = $additions->registration;
    $node->nid = NULL;
  }
  else
  	{
		$additions = registration_load($node);
    	$node->registration = $additions->registration;
	}

  $form['registration']['license_key'] = array(
    '#type' => 'textfield',
    '#title' => t('License Details'),
    '#required' => FALSE,
    '#default_value' => $node->registration['license_key'], 
    '#weight' => -9
  );
  
  $form['registration']['comp_org'] = array(
    '#type' => 'textfield',
    '#title' => t('Company/Organization'),
    '#required' => TRUE,
    '#default_value' => $node->registration['comp_org'], 
    '#weight' => -7
  );
  
  $form['registration']['salutation'] = array(
    '#type' => 'select',
    '#title' => t('Salutation'),
	'#options' => $sal_oprions,
    '#required' => FALSE,
    '#default_value' => variable_get('registration_salutation', $node->registration['salutation']), 
    '#weight' => 3
  );
  
  $form['registration']['lname'] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
    '#required' => TRUE,
    '#default_value' => variable_get('registration_lname', $node->registration['lname']), 
    '#weight' => 4
  );
  
  $form['registration']['fname'] = array(
    '#type' => 'textfield',
    '#title' => t('First Name'),
    '#required' => FALSE,
    '#default_value' => $node->registration['fname'], 
    '#weight' => 5
  );
  
  $form['registration']['passwd'] = array(
    '#type' => 'password',
    '#title' => t('Password'),
    '#required' => TRUE,
    '#default_value' => variable_get('registration_passwd', ''), 
    '#weight' => 14
  );
  
  $form['registration']['title'] = array(
    '#type' => 'hidden',
    '#title' => t(''),
    '#required' => FALSE,
    '#default_value' => variable_get('registration_regular_info', 'Member Registration'), 
    '#weight' => 19
  );
  
  $form['registration']['filter'] = filter_form($node->format);

  return $form;
}
ainigma32’s picture

Probably a stupid question: where are you adding the categories to your form?
And for determining the order of the items you can use the weight http://api.drupal.org/api/file/developer/topics/forms_api_reference.html... of an item (the higher the lower it gets)

- Arie

ainigma32’s picture

Status: Postponed (maintainer needs more info) » Fixed

Looks like manishaneja won't be posting any feedback so I'm setting this to fixed.

Feel free to reopen if you think that is wrong.

- Arie

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.