Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
removed "Drupal" from the title
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How does drupaldo autocomplete textfieldstext fields work?

I am asking this question because I have an autocomplete text field with #autocomplete_path set to a valid working path but key events are not handled by the misc/autocomplete.jsmisc/autocomplete.js file. When the form is being created, it apparently assigns all the functions to the respective variables, but none of those functions are executed. For example following function in the misc/autocomplete.jsmisc/autocomplete.js isn't executed:.

Drupal.jsAC = function ($input, db) {
  var ac = this;
  this.input = $input[0];
  this.ariaLive = $('#' + this.input.id + '-autocomplete-aria-live');
  this.db = db;

  $input
    .keydown(function (event) { return ac.onkeydown(this, event); })
    .keyup(function (event) { ac.onkeyup(this, event); })
    .blur(function () { ac.hidePopup(); ac.db.cancel(); });

};

Hence, when a user types a letter, key upkey up or key downkey down handlers aren't invoked and nothing happens. So to debug, I want to know how drupal autocomplete works. I've been pulling my hairs and banging my head couple of days to figure out what's wrong. 

Could someone please explain how this works?

How does drupal autocomplete textfields work?

I am asking this question because I have an autocomplete text field with #autocomplete_path set to a valid working path but key events are not handled by the misc/autocomplete.js file. When the form is being created it apparently assigns all the functions to the respective variables, but none of those functions are executed. For example following function in the misc/autocomplete.js isn't executed:

Drupal.jsAC = function ($input, db) {
  var ac = this;
  this.input = $input[0];
  this.ariaLive = $('#' + this.input.id + '-autocomplete-aria-live');
  this.db = db;

  $input
    .keydown(function (event) { return ac.onkeydown(this, event); })
    .keyup(function (event) { ac.onkeyup(this, event); })
    .blur(function () { ac.hidePopup(); ac.db.cancel(); });

};

Hence when a user types a letter, key up or key down handlers aren't invoked and nothing happens. So to debug, I want to know how drupal autocomplete works. I've been pulling my hairs and banging my head couple of days to figure out what's wrong. Could someone please explain how this works?

How do autocomplete text fields work?

I am asking this question because I have an autocomplete text field with #autocomplete_path set to a valid working path but key events are not handled by the misc/autocomplete.js file. When the form is being created, it apparently assigns all the functions to the respective variables, but none of those functions are executed. For example following function in the misc/autocomplete.js isn't executed.

Drupal.jsAC = function ($input, db) {
  var ac = this;
  this.input = $input[0];
  this.ariaLive = $('#' + this.input.id + '-autocomplete-aria-live');
  this.db = db;

  $input
    .keydown(function (event) { return ac.onkeydown(this, event); })
    .keyup(function (event) { ac.onkeyup(this, event); })
    .blur(function () { ac.hidePopup(); ac.db.cancel(); });

};

Hence, when a user types a letter, key up or key down handlers aren't invoked and nothing happens. So to debug, I want to know how autocomplete works. 

Could someone please explain how this works?

Rollback to Revision 2 - Edit approval overridden by post owner or moderator
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

How do Drupal 7does drupal autocomplete textfields work?

Tweeted twitter.com/#!/StackDrupal/status/423074313009655808
edited tags
Link
Bala
  • 5.2k
  • 6
  • 24
  • 40
Loading
Source Link
lloydh
  • 61
  • 1
  • 4
Loading