Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293360

#ajax doesn't work if element CSS ID attribute set

$
0
0

Note: I had this problem with 'select' and 'textfield' form '#type' elements so I'm not sure if it applies to all.

In creating a ajax-enabled form element I have something like the following:

<?php
$element = array(
  '#type' => 'textfield',
  '#default_value' => '',
  '#attributes' => array('id' => 'textfield_css_id'),
  '#ajax' => array(
    'wrapper' => 'ajax_update_css_id',
    'callback' => 'MYMODULE_some_ajax_callback
  ),
);

The rest of my functions/callbacks are already in and working.

The ajax functionality works when the "#attribute => array('id' => 'SOMENAME')' is commented out.

The ajax functionality fails to work when the line remains.

I'm not sure if there is another thread on this but I wanted to point it.


Viewing all articles
Browse latest Browse all 293360

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>