phantomamazz2011-06-09 15:42:59
phantomamazz, 2011-06-09 15:42:59

Ajax in Drupal 7

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] 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

2 answer(s)
Maxim, 2011-06-09

Is there a mention of overlay-ajax in the raws?
I advise you to install Firebug and look at the messages in the console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question