This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

form_values missing a value?

All,

I can't seem to put my finger on this. I have a simple form with three fields. It works perfectly, until I create a theme() function for it. Here's the form code:

    $form['term'] = array (
      '#type' => 'textfield','#title' => 'Query String',
      '#required' => TRUE,'#default_value' => $term,
      '#autocomplete_path' => 'staff/autocomplete',
      '#size' => 32,'#maxlength' => 128);
    $form['type'] = array(
      '#type' => 'select','#title' => 'Type','#default_value' => $type,
      '#options' => array ('callhistory' => t('History'),'authlog' => t('Authentication')));
    $form['when'] = array(
      '#type' => 'select','#title' => 'When','#default_value' => $when,
      '#options' => array (
          'today' => t('Today'),'yesterday' => t('Yesterday'),
          'week' => t('This Week'),'lastweek' => t('Last Week'),
          'month' => t('This Month'),'lastmonth' => t('Last Month')));
    $form['submit'] = array('#type' => 'submit','#title' => 'blah','#value' => t('Go'));

Here's the theme code:
<?php
function XXtheme_staff ($form) {
$output = '

';
$output .= form_render($form['term']);
$output .= '
';
$output .= form_render($form['type']);
$output .= '
';
$output .= form_render($form['when']);
$output .= '
';
$output .= form_render($form['submit']);

Drupal / Moodle Integration Issues for Drupal 4.7

I am experimenting with Moodle as a backend to Drupal for course management, but I've run into two limitations and I wonder if anyone is able to offer solutions...

how to disable form api check the value actually existed in the select ?

  $form[test']['pcs'] = array ('#type' => 'select', '#title' => "", '#default_value' => $node->pcs, '#options' => $pcs);
  $activeselect = module_exist('activeselect');
  if($activeselect){	
    $form['test']['pcs']['#type'] = 'activeselect';
    $form['test']['pcs']['#activeselect_path'] = 'pxxy/activeselect';
    $form['test']['pcs']['#activeselect_targets'] = "jwh";
    $form['test']['pcs']['#activeselect_extra'] = '';
  }
 
  $jwhs = jwh_all();
  ksort($jwhs);

Making Glossary work with 4.7 and Categories

I'm missing the basics of getting started building a Glossary. A few minutes from someone who knows would be greatly appreciated. I am using Drupal 4.7, the newest version of Categories, the taxonomy wrapper, and have flexinode installed.

How do I get started? I don't see any settings for glossary anywhere?
Thanks

Retrieving a module's filename from the code...

When coding in various *nuke flavors you can grab the filename from the module's code with the following statement:

$module_name = basename(dirname(__FILE__));

Does Drupal have anything similar that one can use?

Cannot figure out how to override form them

I have been reading up on trying to override the rendering of certain elements in my form but am making a mistake somewhere.

I have a generic node type created and inside the hook_form element have placed the following code...

 $form['#theme'] = '_theme_game_form';

Shouldn't this tell Drupal to send the form through this function before outputting to the screen?

Well it isn't so I must be making a mistake.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions