Answer the question
In order to leave comments, you need to log in
Ajax in Drupal 7
Hey!
Question for Drupal experts.
The task is this: on the form, you need to track when the user selects another element in the drop-down list and dynamically change the contents of the other list. Having digested a bunch of information, I began to do it through Ajax.
In hook_form_alter for the element that will need to be dynamically changed, added:
$form['field_from']['#prefix'] = '';
$form['field_from']['#suffix'] = '';
In the same place, for the list to be tracked, I added:
$form['field_type']['#ajax'] = array(
'callback' => 'cntuploader_refresh_callback',
'wrapper' => 'from-selection',
'method ' => 'replace',
When manipulating the field_type element, the callback function is never called, no POST requests are sent. In the Apache logs sometimes (but not always and rarely) the following entry appears:
[error] [client 127.0.0.1] File does not exist: /var/www/html/overlay-ajax, referer: localhost
Is this somehow related to my problem?
I would be very grateful if someone could tell me what I am doing wrong. I've already broken my head.
Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question