Skip to content

rafenden/drupal-conditional

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

It's a fork of Conditional Fields module that works with any Drupal elements.

Provides two render properties: #visible_when and #required_when.

Examples:

$form['source'] = [
  '#title' => t('How did you hear about us'),
  '#type' => 'select',
  '#options' => [
    'internet_search' => t('Internet search'),
    'friend' => t('From a friend'),
    'other' => t('Other, please specify below'),
  ],
];

$form['source_other'] = [
  '#title' => t('Other source'),
  '#type' => 'textfield',
  '#visible_when' => [
    'source' => 'other',
  ],
];

About

Drupal module to define dependencies between form elements based on their states and values

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published