I have develop many custom form and added ajax functionality with the form field, Ajax code works like a charm with my custom form.
But now i have a situation where i have add ajax callback to the title field of node.
For this i am using hook_form_alter, and adding same ajax code to title, but ajax event is not firing up for title field.
below is my code:
function module_form_FORM_ID_alter(&$ form, FormStateInterface $ form_state, $ form_id){ $ form['title']['#ajax'] = [ 'callback' => 'module_updateCategoryDropDown', 'event' => 'change', 'progress' => [ 'type' => 'throbber', 'message' => t('Verifying...'), ], ]; } function module_updateCategoryDropDown(array &$ form, FormStateInterface $ form_state){ /* form category dropdown code is here */ }