comment form by drupal_get_form doesn't get ajaxed

Created on 7 August 2011, about 14 years ago
Updated 25 July 2025, 22 days ago

Hi,

I'm using drupal_get_form('comment_form', array('nid' => $node->nid)) to print the comment form where i want it.

The form appears ok, but no ajax.
This module isn't even being processed, but there is a wrapper class "comment".

do you know why this form can't get ajax?

thanks

Feature request
Status

Active

Version

1.8

Component

Code

Created by

🇧🇷Brazil carvalhar

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.

  • When drupal_get_form('comment_form', ...) doesn't yield an AJAX-enabled form, it's usually because the necessary Drupal AJAX JavaScript files (like drupal.ajax.js and jquery.form.js) aren't being loaded or properly attached to the form elements. Simply printing the form array with print $form often bypasses Your Texas Benefits the process that adds these crucial scripts and their associated Drupal.settings. To fix this, ensure core AJAX libraries are added (e.g., via drupal_add_library('system', 'drupal.ajax')) and that the form is properly rendered using render($form) within Drupal's rendering pipeline. If you're loading the form via your own custom AJAX, you'll also need to explicitly call Drupal.attachBehaviors() on the newly inserted content in your JavaScript.

Production build 0.71.5 2024