For the drupal 7 version we had this:

    // Disable form elements when not needed.
    if (empty($field_options)) {
      $form['custom']['#description'] = t('All the options are hidden, you need to add fields first.');
      $form['custom']['fc_title']['#type'] = 'hidden';
      $form['custom']['fc_title_field']['#disabled'] = TRUE;
      $form['custom']['fc_url']['#type'] = 'hidden';
      $form['custom']['fc_url_field']['#disabled'] = TRUE;
      $form['custom']['fc_date']['#type'] = 'hidden';
      $form['custom']['fc_date_field']['#disabled'] = TRUE;
    }
    if (empty($date_fields)) {
      $form['custom']['fc_date']['#type'] = 'hidden';
      $form['custom']['fc_date_field']['#disabled'] = TRUE;
    }

Sadly the #disabled = TRUE doesn't seem to work for the D6 version. OR it is broken to in D7 :)

Comments

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new1.6 KB

#disabled works for me. And it's in the fapi reference: http://api.drupal.org/api/drupal/developer--topics--forms_api_reference....

This patch seems to work.

aspilicious’s picture

Status: Needs review » Needs work
StatusFileSize
new63.38 KB

Nop it doesn't work like it should work.

aspilicious’s picture

Title: Hide views options if not needed » [beta blocker] Hide views options if not needed

Changing title to reflect what we need to get in for the 6.2 release

tim.plunkett’s picture

aspilicious’s picture

Title: [beta blocker] Hide views options if not needed » Hide views options if not needed

No more beta blocking

Status: Fixed » Closed (fixed)

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