How to add ajax element to checkbox.

Created on 7 June 2019, about 6 years ago
Updated 27 June 2025, 10 days ago

I want to add ajax to check form but it is not working.

$form[$term->tid]['checkbox'] = array(
'#type' => ($multiple) ? 'checkbox' : 'radio',
'#title' => $term->name, // Escaping is done in theme wrappers.
'#value' => $value,
'#return_value' => $term->tid,
'#ajax' => array(
'callback' => 'ajax_example_autocheckboxes_callback',
'wrapper' => 'checkboxes-div',
'method' => 'replace',
'effect' => 'fade',
),
'#required' => FALSE,
'#theme_wrappers' => ($multiple) ? array('taxonomy_manager_tree_checkbox') : array('taxonomy_manager_tree_radio'),
'#highlight' => in_array($term->tid, $terms_to_highlight) ? TRUE : FALSE,
);

💬 Support request
Status

Closed: outdated

Version

1.0

Component

Code

Created by

🇮🇳India murali97

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024